pkgjs / support

Package Support Format
MIT License
24 stars 7 forks source link

Why to throw an error when missing command ? #23

Closed helio-frota closed 3 years ago

helio-frota commented 3 years ago
$ node bin/support 
error   › You must specify the command to run
Error: You must specify the command to run
at Array.fail (/home/hf/code/pkgjs/support/lib/cli/index.js:21:11)
at Object.fail (/home/hf/code/pkgjs/support/node_modules/yargs/build/lib/usage.js:37:25)
at Object.nonOptionCount (/home/hf/code/pkgjs/support/node_modules/yargs/build/lib/validation.js:24:27)
at Object.runValidation [as _runValidation] (/home/hf/code/pkgjs/support/node_modules/yargs/build/lib/yargs.js:1154:20)
at Object.parseArgs [as _parseArgs] (/home/hf/code/pkgjs/support/node_modules/yargs/build/lib/yargs.js:1124:26)
at Object.parse (/home/hf/code/pkgjs/support/node_modules/yargs/build/lib/yargs.js:584:29)
at /home/hf/code/pkgjs/support/lib/cli/index.js:109:24
at Object.<anonymous> (/home/hf/code/pkgjs/support/bin/support:2:24)
at Module._compile (internal/modules/cjs/loader.js:1076:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10) 

support <command> [options]

Commands:
  support badges    Output badges markdown based on support
  support setup     Setup a support declaration for a package
  support show      Show support information
  support validate  Validate support information schema

Logging:
  --log-level, -l  Set the log level                                                           [string] [default: error]
  --silent, -S     Suppress all output                                                                         [boolean]
  --verbose, -v    Verbose output (alias of --log-level=info)                                                  [boolean]

preferences
  --canonical  Use canonical support info even when local info is available                                    [boolean]
  --fetch      Fetch canonical support info from remote repositories when necessary                            [boolean]
  --base-path  Set top most directory from which local support info files can be read. Defaults to same directory in
               which package.json is located.                                                                   [string]

Options:
  --help     Show help                                                                                         [boolean]
  --version  Show version number                                                                               [boolean]
mhdawson commented 3 years ago

@helio-frota that is probably the behavior of the underlying packages (yargs) that we are using.

helio-frota commented 3 years ago

@mhdawson thanks for the response. I'll investigate that to try to suppress that error.