-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Milestone
Description
By default it seems that any extra argument will be available in an array after the command object.
The issue comes from the fact that it is not a documented behavior, and if the callback does not have this additional array parameter, it will silently be executed.
While this can be useful if you want to parse those extra arguments yourself, I think the default should be to error out when some arguments are not parsed (or at least, give it as an config option).
Right now, one must do the following:
.command('somecommand <filePath>')
.action((filePath, cmdObj, additionalArgs) => {
if (additionalArgs && additionalArgs.length > 0)
{
cmdObj.help();
}
// ...
});It would be nice if something like this could have the same effect:
.command('somecommand <filePath>')
.noExtraArgs(true)
.action((filePath) => {
// ...
});Reactions are currently unavailable