open-wc / custom-elements-manifest

Custom Elements Manifest is a file format that describes custom elements in your project.
https://custom-elements-manifest.open-wc.org/
230 stars 42 forks source link

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

Open jpzwarte opened 3 years ago

jpzwarte commented 3 years ago

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)
thepassle commented 3 years ago

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?

jpzwarte commented 3 years ago

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