Closed tsanyqudsi closed 2 months ago
This was included in 170335113c1b8e43b6741f1c5d500f4fb976a3fa
RE: Error handling, not that part - will keep it in mind. For now my guidance would be custom validators, but those will not work for the requires command portion.
As for now when I run it without
.demandCommand()
it will treat as if the main command is valid and will throw an error if I give no actions there.when I run the default example in the readme and run it without giving any parameter (
node ./dist/cli.js
insteadnode ./dist/cli.js hello --name "World"
), it gave me this :It's not pretty.
So I suggest that it should automatically think that it needs a command if there's no implementation for the cli.
As for the error handling Maybe I want to make it something like
my-cli needs a freakin command, bro!!
instead of writing the detail of the error. I propose to make.errorMessage((error) => string)
to make it better. So I can give the user something likeor instead of making
.errorMessage()
you can include it inCLICommandOptions
type