-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Provide Array of permitted values for an option. #518
Copy link
Copy link
Closed
Labels
Milestone
Description
I have an .option() that is only allowed to be one of "all", "debug" or "none".
I'd like an easy way to pass an Array to an option() and have Commander automatically check that the value passed by the user is one of the permitted values.
Something like this:
.option('-t, --target <target>', 'Specifies the target.', ["all", "debug", "none"])Also including the permitted values in the help output could be useful, provided it's not a very large Array.
I'd gladly do the PR if I can get a response from @tj or a collaborator that this is useful.
Thanks!!
Reactions are currently unavailable