-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
At present, it's really hard to tell whether your command was passed the number of arguments it asked for. I gave up and patched commander, and still had to check in two places (one for too many, one for zero; too few and greater than zero are checked automatically by the argument parser).
A solution would be to insist that the arguments have to match the syntax (i.e. optional arguments may be omitted, required arguments must be present, additional arguments are not allowed), and if zero arguments is not a valid number, treat that case as if "--help" were given (but preferably exit with error).
I have a patch for this which I can make into a pull request.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels