Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -h and --help flags to the command line tool #62

Open
koffie opened this issue Apr 22, 2022 · 0 comments
Open

Add -h and --help flags to the command line tool #62

koffie opened this issue Apr 22, 2022 · 0 comments

Comments

@koffie
Copy link

koffie commented Apr 22, 2022

I was trying to figure out what kind of options the command line tool has and my first instinct was just to add "-h" or "--help" to it like most command line tools would support however this just gives a very uninformative error message.

More general it would be nice to display a short usage message when supplying incorrect command line arguments

$ canopy -h           
The "to" argument must be of type string. Received undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "to" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:372:5)
    at validateString (node:internal/validators:120:11)
    at relative (node:path:1192:5)
    at resolvePaths (/usr/local/lib/node_modules/canopy/bin/canopy:27:15)
    at main (/usr/local/lib/node_modules/canopy/bin/canopy:39:33)
    at run (/usr/local/lib/node_modules/canopy/bin/canopy:64:11)
    at Object.<anonymous> (/usr/local/lib/node_modules/canopy/bin/canopy:72:1)
    at Module._compile (node:internal/modules/cjs/loader:1099:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)

$ canopy --help
The "to" argument must be of type string. Received undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "to" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:372:5)
    at validateString (node:internal/validators:120:11)
    at relative (node:path:1192:5)
    at resolvePaths (/usr/local/lib/node_modules/canopy/bin/canopy:27:15)
    at main (/usr/local/lib/node_modules/canopy/bin/canopy:39:33)
    at run (/usr/local/lib/node_modules/canopy/bin/canopy:64:11)
    at Object.<anonymous> (/usr/local/lib/node_modules/canopy/bin/canopy:72:1)
    at Module._compile (node:internal/modules/cjs/loader:1099:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant