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

Support for hidden commands #188

Closed
tschaub opened this issue Jun 23, 2015 · 2 comments
Closed

Support for hidden commands #188

tschaub opened this issue Jun 23, 2015 · 2 comments

Comments

@tschaub
Copy link
Contributor

tschaub commented Jun 23, 2015

There are cases where it would be nice to hide some commands from the help/usage output. An example would be setup or post-install work that is not part of the typical user workflow (e.g. completion). The help output becomes less useful when it is diluted with these one-time or setup type commands.

This could be supported by not adding usage for commands with false for a description. E.g.

yargs.command('post-install', false, handler);

If someone wanted the completion command to not show up in the help doc, this could be made to work:

yargs.completion('completion', false);

Only commands that are registered with usage are eligible for completion, so "hidden" commands would not show up as completion candidates. I think this is consistent with being hidden.

Prior art:

@bcoe
Copy link
Member

bcoe commented Jun 24, 2015

I like the idea of explicitly providing a false description, we could continue to have undefined default to a default description.

Big 👍 from me.

@bcoe
Copy link
Member

bcoe commented Jun 28, 2015

@tschaub I've published your changes to yargs@next:

npm install yargs@next

there's a chance I might do a bit of hacking on yargs this weekend too, and will get a release yargs@latest out the door sometime Sunday.

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

No branches or pull requests

2 participants