-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More consistent way of adding command arguments #1490
Conversation
added addArguments method
Allowing no brackets around argument name and defaulting to required option, but not documenting for now. i.e. |
Not documenting |
Might be done! (Edit: no, was not done!) I am going to have a look at the Argument data property names, but they are consistent with Option and Command. Having a plain data property name like Mentioned property names in #1467 (comment) Update: keep properties private for now (Like Command.) |
Also I will have another look at the README introduction of the arguments, as the "inline" form with |
I have had another go at the README to try and tidily cover the multiple approaches to specifying command-arguments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8️⃣
Pull Request
Problem
The syntax for adding command arguments which have help descriptions is quite different from the rest of the API, and arguments and options are added quite differently although they could be similar. (Prompted by discussion about offering .choices() for arguments in #1458)
Related: #1458 #1467 #1471
Solution
This builds on PR #1467. With positive feedback about the new method in #1471., switching over "normal" way of adding an argument in README and examples and tests from
.arguments()
to.argument()
..argument(name, description)
method.option(flags, description)
addArgument(arg)
method for future expansion.addOption(opt)
cmd.description(cmdDescription, argsDescription)
ChangeLog
cmd.argument(name, description)
for adding command-argumentscmd.description(desc, argDescriptions)
for adding argument descriptions (removed from README).visibleArguments()
returns array ofArgument