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
feat: --show-hidden #1061
feat: --show-hidden #1061
Conversation
34516e5
to
7da064b
Compare
The code looks fine, but maybe you could write some UT for that? |
fc1d700
to
8e3d953
Compare
@Morishiri done |
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.
this looks good to me 👍 but mind adding the showHidden
method to the api docs?
Adds a `--show-hidden` flag to show options defined with `hidden: true` property Recap: Earlier, a fix was made to address the issue where `.options({...})` without a `description` property did not show up up in `--help`. The fix introduced a new `hidden: true` property to truly hide an option from `--help`, and to show all other options (even without `description` property) Issue with the fix: There was no way to show options defined with `hidden:true` property (they were hidden permanently) Solution (this patch): This introduces a new flag: `--show-hidden` which is pre-configured. It can be used to show those hidden options. The default key for this new flag may also be custom configured with a new function property `.showHidden()`
8e3d953
to
af62bb6
Compare
@gajus @laggingreflex @Morishiri thanks for the help landing this feature, sorry that it took so long to get over the finish line. |
Hi, I was looking for such feature. I am using 11.0.0, I presume this have not been release yet right ? |
It's released in 11.1.0 but there seems to be an issue regarding latest npm release. Try installing/setting 11.1.0 version manually. |
@laggingreflex thanks, I have updated to I have the following options: .option('copyright-holder', {
alias: 'c',
describe: 'Change the default copyright-holder',
hidden: true,
}) Executing the cli with Options:
--version Show version number [boolean]
--help Show help [boolean] |
You also need to execute |
@laggingreflex so we must have this hidden program documented to everyone? |
@kopax I'm not sure I understand, could you please elaborate with an example. |
Sure for example this use case: I want to have a I want to keep the |
@kopax If I understand correctly, what you tried earlier should work. I.e. without If that doesn't work, or it's not what you wanted, could you please open a new detailed issue, possibly with a reproduction repo and expected vs. actual outputs. |
Adds a
--show-hidden
flag to show options defined withhidden: true
propertyRecap: (#962) Earlier, a fix was made to address the issue where
.options({...})
without adescription
property did not show up up in--help
. The fix introduced a newhidden: true
property to truly hide an option from--help
, and to show all other options (even withoutdescription
property)Issue with the fix: There was no way to show options defined with
hidden:true
property (they were hidden permanently)Solution (this patch): This introduces a new flag:
--show-hidden
(pre-configured) which can be used to show those hidden options.The default key for this new flag may also be custom configured with a new function property
.showHidden('custom-show-hidden')