You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our commander.js usage is all here and as far as I can tell im following documented usage. But, our options are not working as expected.
All commands suffer the same issue, butt an example:
program.command('lint <file-or-url>').description('ensure specs are not just valid OpenAPI, but lint against specified rules').option('-q, --quiet','reduce verbosity').option('-r, --rules [ruleFile]','provide multiple rules files',collect,[]).option('-s, --skip [ruleName]','provide multiple rules to skip',collect,[]).option('-j, --json-schema','treat $ref like JSON Schema and convert to OpenAPI Schema Objects (default: false)').option('-v, --verbose','increase verbosity').action(lint.command);
I would expect the command speccy lint -j foo.yaml to work the same way that I would expect speccy lint foo.yaml -j to work, but the first command gives this output:
node speccy lint --json-schema test/samples/json-schema/openapi.yaml
Usage: speccy <command> [options]
Options:
-V, --version output the version number
-c, --config [configFile] config file (containing JSON/YAML). See README for potential values.
-h, --help output usage information
Commands:
lint [options] <file-or-url> Ensure specs are not just valid OpenAPI, but lint against quality control rules
resolve [options] <file-or-url> Pull in external $ref files to create one mega-file
serve [options] <file-or-url> Display specifications in beautiful human readable documentation
Any ideas here?
The text was updated successfully, but these errors were encountered:
You are getting a false positive from this line in speccy.js:
if(!program.args.length)program.help();
program.args has what is left-over from commander parsing, whereas for displaying help you want to check the original arguments passed to your program. (I am a bit surprised by the difference in behaviour you are seeing, but not relevant to fix.)
I maintain Speccy and we've got a confusing bug.
Our commander.js usage is all here and as far as I can tell im following documented usage. But, our options are not working as expected.
All commands suffer the same issue, butt an example:
I would expect the command
speccy lint -j foo.yaml
to work the same way that I would expectspeccy lint foo.yaml -j
to work, but the first command gives this output:Any ideas here?
The text was updated successfully, but these errors were encountered: