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
Show hidden options #974
Show hidden options #974
Conversation
Adds an `opts` agument to `showHelp` Currently, to enable showing hidden options: ```js showHelp('log', {hidden: [true|false]}) ```
f764d46
to
477b7d7
Compare
@laggingreflex I feel like it would potentially limit the number of folks who find this feature, by forcing a user to handle the help output themselves -- it also means that features like validation are a bit less interesting; I'm not the biggest fan of adding I'm heads down trying to get a few more things patched for |
@laggingreflex coming back to this issue after putting it down for a bit; I think that the suggestion of:
is pretty reasonable -- any interest in rebasing with this functionality? |
I don't think it is optimal. It requires code change to change CLI behaviour. Users will opt-in to use an arbitrary environment variable to control this feature instead, e.g. yargs.showHelp('log', {showHidden: process.env.MY_SHOW_HIDDEN}) Hidden options is yargs feature and as such yargs should provide a standardised way to control the behaviour instead of "outsourcing" the decision to the consumers. |
@gajus I dislike that having a command line argument like Perhaps there's an argument |
You could argue the same about Are you specifically opposing
|
@gajus I'm specifically objecting to the @laggingreflex, @gajus would either of you like to see this over the finish line? Otherwise I hopefully will carve some time for open source out over the holiday. |
Superseded by #1061 |
In #962 a new option was added
{hidden: true}
that hides an option from--help
(instead of by omitting the description)To show these hidden options, one of the suggestion was to use
--yargs-show-hidden
(@gajus).How about instead, modify the
showHelp
like this:This gives the user more control. Like maybe they wouldn't want to show hidden commands at all. Or maybe they'd want it behind a custom flag. This way they can implement it themselves.
It however require that the user implements the
--help
themselves too: