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

Add autoVersion and autoHelp options #68

Merged
merged 8 commits into from
Nov 26, 2017

Conversation

angeloashmore
Copy link
Contributor

@angeloashmore angeloashmore commented Sep 6, 2017

Fixes #62

Adds autoVersion and autoHelp options. If either is set to false, meow won't handle printing on --version and --help. This would allow for explicit handling of showing either, possibly in a subcommand context.

Note: I had to add an extra \n to the spawn cli and show help screen test to pass. Not sure if this due to my shell?

@sindresorhus
Copy link
Owner

You can already do this with the help and version option.

@angeloashmore
Copy link
Contributor Author

By setting the values to false? I would still like meow to handle help and version messages, but not in every case. Sorry, maybe I'm missing something?

Here's my use case:

$ myapp --help

I would like this to print the help message defined for myapp.

$ myapp subcommand --help

myapp calls myapp-subcommand in a child process and passes the arguments. I would like myapp-subcommand's help message to be printed, but myapp is seeing the --help and printing it's own message.

This PR would allow me to disable help and version handling in meow, but still use the showHelp function when necessary.

Another option is to alias the help and version flags in myapp to something else and handle the flags manually, but I thought this might be another option.

@angeloashmore
Copy link
Contributor Author

@sindresorhus any thoughts on this? I'll close it out if you feel it's unnecessary. 🙂

@sindresorhus
Copy link
Owner

sindresorhus commented Sep 29, 2017

Sorry for the late response. Yes, this makes sense. Can you remove the false support in the help and version options, as it's no longer needed with this option (in code, test, and readme).

@sindresorhus sindresorhus changed the title Add autoVersion and autoHelp opts Add autoVersion and autoHelp options Sep 29, 2017
@angeloashmore
Copy link
Contributor Author

Sorry, I'm way late on revisiting this. Just pushed some commits to the PR.

  • Removes false support for help and version
  • Adds showVersion function to complement showHelp
  • Updates the documentation

@sindresorhus sindresorhus merged commit 59dda7a into sindresorhus:master Nov 26, 2017
@sindresorhus
Copy link
Owner

Thanks :)

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

Successfully merging this pull request may close these issues.

2 participants