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

How to disable help subcommand? #1490

Closed
christianbundy opened this issue Nov 22, 2019 · 6 comments
Closed

How to disable help subcommand? #1490

christianbundy opened this issue Nov 22, 2019 · 6 comments
Labels

Comments

@christianbundy
Copy link

I have an subcommand called help that's not getting called because yargs is assuming that I mean --help. How can I disable this?

$ over the rainbow help
over the rainbow

Commands:
  over the rainbow help
  over the rainbow snazzy

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]
@bcoe bcoe added the question label Nov 22, 2019
@bcoe
Copy link
Member

bcoe commented Nov 22, 2019

@christianbundy you can specify .help(false) if I recall, and then implement your own help logic with showHelp().

@daguej
Copy link

daguej commented Dec 19, 2019

.help(false) does not appear to be working correctly. See #1516

@mleguen
Copy link
Member

mleguen commented Jan 8, 2020

@daguej As commented in #1516, help(false) seems to be working as expected.

Could you please provide some sample code with your help subcommand not being called?

@mleguen
Copy link
Member

mleguen commented Jan 8, 2020

@christianbundy Could you please provide some sample code with your help subcommand not being called?

@daguej
Copy link

daguej commented Jan 8, 2020

See this comment, it looks like the bug only happens when you have a default command with help(false) and other commands with help enabled.

@mleguen
Copy link
Member

mleguen commented Feb 12, 2020

Closing as .help(false) answers the initial question here, and #1516 is about a more specific use case (disabling global help, and re-enabling help for some subcommands).

@mleguen mleguen closed this as completed Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants