Skip to content

Commit eb01457

Browse files
committed
Set expandContext only for expand command.
1 parent 5b2e13c commit eb01457

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

bin/jsonld.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,6 @@ function _jsonLdOptions(command, input) {
208208
options.safe = true;
209209
}
210210

211-
if(command.context) {
212-
options.expandContext = command.context;
213-
}
214-
215211
options.base = _getBase(command, input);
216212

217213
// setup documentLoader
@@ -339,6 +335,10 @@ _jsonLdCommand(program.command('expand [filename|URL|-]'))
339335
.option(' --keep-free-floating-nodes', 'keep free-floating nodes')
340336
.action(async function expand(input, cmd) {
341337
input = input || '-';
338+
if(cmd.context) {
339+
cmd.expandContext = cmd.context;
340+
delete cmd.context;
341+
}
342342
const options = _jsonLdOptions(cmd, input);
343343
options.keepFreeFloatingNodes = cmd.keepFreeFloatingNodes;
344344

0 commit comments

Comments
 (0)