-
-
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
Poll: change api for adding command arguments? #1471
Comments
program
.arguments('<username> [password]')
.description('test command', {
username: 'user to login',
password: 'password for user, if required'
}) Suggested syntax: program
.description('test command')
.argument('<username>', 'user to login')
.argument('[password]', 'password for user, if required') Should |
program
.arguments('<cmd> [args]'); Suggested syntax:
Should |
Not huge numbers, but unanimous positive response after a month. (Thanks for feedback.)
|
I found I can coerce options with a function as a third parameter. Eg: program
.argument('<username>', 'user to login', (value) => value.toLowerCase()) |
Yes, planned and done. |
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.)A couple of questions for feedback via reactions or comments.
The text was updated successfully, but these errors were encountered: