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

Display a hint on how to open the help when entering a unknown switch #482

Closed
MoritzKn opened this issue Dec 24, 2015 · 5 comments
Closed

Comments

@MoritzKn
Copy link

MoritzKn commented Dec 24, 2015

For example: if I enter the cp command with a wrong switch, it displays how to show the help:

$ cp -y
cp: invalid option -- 'y'
Try 'cp --help' for more information.

If you don't want to hard code this, one option would be to give the programmer the ability to specifies an 'unknown option handler'.

@hongkongkiwi
Copy link

+1 for this

@jahbini
Copy link

jahbini commented Apr 20, 2016

function allowUnknownOptions has no discernable effect. The default action on unknowns is to eat the next option. calling allowUnknownOptions(false) should abort processing and show help if any funny flags are present.

@MoritzKn MoritzKn changed the title Display a hint to the help after entering a unknown option Display a hint on how to open the help when entering a unknown switch Jan 31, 2017
@willxy
Copy link

willxy commented Jul 1, 2018

+1 for this. I want to be able to print out usage help when an unrecognized option is given.

@shadowspawn
Copy link
Collaborator

This issue has not had any activity in over six months. It isn't likely to get acted on due to this report.

Feel free to open a new issue if it comes up again, with new information and renewed interest.

Thank you for your contributions.

@shadowspawn
Copy link
Collaborator

Related: .showHelpAfterError() added in prerelease v8.0.0-2 by PR #1534

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

5 participants