custom-elements-manifest icon indicating copy to clipboard operation
custom-elements-manifest copied to clipboard

Stack trace is printed if you specify unknown CLI options to `analyze`

Open jpzwarte opened this issue 3 years ago • 2 comments

cem --help works fine

cem analyze --help doesn't:

(node:33622) UnhandledPromiseRejectionWarning: UNKNOWN_OPTION: Unknown option: --help
    at commandLineArgs (/Users/jeroenz/Projects/dna/core/node_modules/command-line-args/dist/index.js:1374:21)
    at getCliConfig (file:///Users/jeroenz/Projects/dna/core/node_modules/@custom-elements-manifest/analyzer/src/utils/cli.js:73:10)

Not just --help, but any property cem doesn't know about, so cem analyze --silent:

(node:33623) UnhandledPromiseRejectionWarning: UNKNOWN_OPTION: Unknown option: --silent
    at commandLineArgs (/Users/jeroenz/Projects/dna/core/node_modules/command-line-args/dist/index.js:1374:21)
    at getCliConfig (file:///Users/jeroenz/Projects/dna/core/node_modules/@custom-elements-manifest/analyzer/src/utils/cli.js:73:10)

jpzwarte avatar Aug 19 '21 10:08 jpzwarte

cem analyze --help is kind of like saying npm install --help. What would you exactly expect to happen? To analyze, or output a help menu?

thepassle avatar Aug 19 '21 10:08 thepassle

@thepassle output specific analyze help, or if there are no specific analyze options, output the generic help. But always output help when passing --help.

jpzwarte avatar Aug 19 '21 11:08 jpzwarte