Skip to content

Commit

Permalink
Add --context to lint command.
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBlueHat committed Mar 27, 2024
1 parent aa81337 commit f2ef260
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/jsonld.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,13 @@ _jsonLdCommand(program.command('format [filename|URL|-]'))

_jsonLdCommand(program.command('lint [filename|URL|-]'))
.description('lint JSON-LD')
.option('-c, --context <filename|URL>', 'context filename or URL')
.action(async function lint(input, cmd) {
input = input || '-';
const options = _jsonLdOptions(cmd, input);
if(cmd.context) {
options.expandContext = cmd.context;
}

await jsonld.expand(input, {
...options,
Expand Down

0 comments on commit f2ef260

Please sign in to comment.