-
-
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
Enable custom help description messages for -V and -h #870
Conversation
* Add description argument to .version() * Add command .helpDescription() For overriding default -h and -V flag help descriptions. * Capitalize default help descriptions -V: 'Output version number' -h: 'Output usage information' * Add example (help-description.js) * Add test (test.command.helpDescription) * Update Readme
Can't change |
Just making some notes. There are requests to be able to change the flags for version and help, conflicts with user defined flags, change the description (like this PR), or the behaviour, or disable the help, et al. I am wondering if the best approach is to allow turning off either of the default |
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.
Thanks @zentus
-
I like adding the description to the
.version
call in consistent way with.option
itself and with optional parameters so no code changes required for existing behaviour. You have updated the JSDoc description. Are you able to update the TypeScript definition too, or would you like a hand with that? -
I do not like changing
output ...
toOutput ...
, simple as it might seem, and I expect you suggested it to match the other descriptions in the README! However, it has been that way for 7 years and IMHO the change is not compelling enough to justify the churn. In my own program, I used lowercase for all my option descriptions to match the built-in options provided by Commander and would be a little annoyed if they changed. And if people really want upper case, with your change they will be able to change some of it themselves... -
.helpDescription
is a reasonable suggestion, but I do not want to add a routine just for the description. People want to be able to change the help flags or the description or suppress the behaviour entirely, so I think we need a more general solution than just the description. (For comparison, after your change.version
will be optional, and allow custom flags, and allow custom description.)
Adding reference to related issue: #47 |
I am not sure I understand what changes you wish me to make.
|
Thanks for reply @zentus. The other Pull Request has leaped ahead, so I'll switch to working with it for now. So no action necessary here unless #963 does not work out. FYI:
Closing in meantime. Will reopen if needed. |
Thank you for your contributions. |
Almost there. |
See |
Enable custom help description messages for -V and -h
Add description argument to .version()
Add command .helpDescription()
For overriding default -h and -V flag help descriptions.
Capitalize default help descriptions
-V: 'Output version number'
-h: 'Output usage information'
Add example (help-description.js)
Add test (test.command.helpDescription)
Update Readme