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

Hiding auto generated help options? #542

Closed
derek-ellison opened this issue May 26, 2016 · 3 comments
Closed

Hiding auto generated help options? #542

derek-ellison opened this issue May 26, 2016 · 3 comments

Comments

@derek-ellison
Copy link

Not sure if this is possible, but it would be nice to tell commander to hide the auto-generated help menu.

So something like,

commander.hideDefaultHelp = true;

That way I can customize my own help menu, without having the auto generated version show up as well.

@dominikwilkowski
Copy link

dominikwilkowski commented Jan 18, 2017

I got around this issue by capturing the option out of process.argv and remove it from process.argv and invoking whatever cool thing you wanted to run.

if( process.argv.indexOf( '-x' ) !== -1 || process.argv.indexOf( '--surround-sound' ) !== -1 ) {
	const position = process.argv.indexOf( '-x' ) !== -1 ? process.argv.indexOf( '-x' ) : process.argv.indexOf( '--surround-sound' );

	process.argv.splice( position, 1 );

	doTheThing();
}

Program.command().option().parse( process.argv );

Hope it helps

@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.

I am closing this as duplicate of #242.

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

Commander v6.1 allows allows disabling the built-in help option: #1325

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

3 participants