Skip to content
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

No way of programmatically displaying help for --show-hidden #2369

Open
paularmstrong opened this issue Oct 16, 2023 · 5 comments
Open

No way of programmatically displaying help for --show-hidden #2369

paularmstrong opened this issue Oct 16, 2023 · 5 comments

Comments

@paularmstrong
Copy link

When hiding options with .hide() or the hide property and trying to output the help documentation using yargs.showHelp(), there is no way to also show the hidden values.

Expected to see one of:

  • yargs.showHelp({ hidden: true })
  • yargs.showHelpHidden(…args)
@shadowspawn
Copy link
Member

You were close, have a look at .showHidden(): https://yargs.js.org/docs/#api-reference-showhidden

(This is an end-user option rather than an author option.)

@paularmstrong
Copy link
Author

(This is an end-user option rather than an author option.)

Yes, but I am asking for an author option.

@shadowspawn
Copy link
Member

What is the use case for this? I understand what you are asking, but I am wondering when you would use this?

@paularmstrong
Copy link
Author

So that I can call yargs.showHelp() and also output the hidden docs? It's nice to hide "advanced" arguments that are not commonly needed.

Why have yargs.showHelp() if it can't output all of the help information?

@shadowspawn
Copy link
Member

Why have yargs.showHelp() if it can't output all of the help information?

Not sure if you were serious or not, but I'll answer as if it was a genuine question.

To allow programatically showing the help. The same help as the user normally sees, with the hidden options hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants