Closed richard-nkrumah closed 8 years ago
Yeah, someone did a PR on options a bit ago to fix another issue and it created this issue. I have to do a number on options to ensure its all set straight. For now, could you make it optional and do a manual validation in your action
method?
+1 for this as well :grin:
I am trying to add a command that has an option with a required argument but the option itself should be ... optional. The following script has been stolen from another issue and shows the problem:
The following should execute the command but it does not:
Adding the option without the required username also misbehaves:
The command does not fail with the "Missing required argument" error I saw in the code.
It seems that the necessity of the option depends only on the presence of "<" in the flags (option.js:20) which makes not only the argument to the option mandatory but the option itself.
Or maybe I am just totally wrong because in issue #52 a similar code snippet worked. But for me it does not.
I am using vorpal 1.5.5 on node v5.4.0.