You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When defining subcommand properties like alias or brief in the parent commands subcommands export, there is no error shown, when a subcommand does not exist:
As you can see, there is no such command like my-cool-command but it is displayed because it is defined in default.ts.
My suggestion is to test if the command exists (or at least if one of the files my-cool-command.js or my-cool-command/default.js exist) and to present the user with an error or at least a warning when it does not.
Example:
$ node bin/app
USAGE
app <subcommand>
SUBCOMMANDS
my-command - It's definitely cool!.
WARN Subcommand 'my-cool-command' is defined but does not exist!
Note that the missing subcommand would not be listed as subcommand and a warning would be displayed below the output.
The text was updated successfully, but these errors were encountered:
When defining subcommand properties like
alias
orbrief
in the parent commandssubcommands
export, there is no error shown, when a subcommand does not exist:As you can see, there is no such command like
my-cool-command
but it is displayed because it is defined indefault.ts
.My suggestion is to test if the command exists (or at least if one of the files
my-cool-command.js
ormy-cool-command/default.js
exist) and to present the user with an error or at least a warning when it does not.Example:
Note that the missing subcommand would not be listed as subcommand and a warning would be displayed below the output.
The text was updated successfully, but these errors were encountered: