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

Using helpOption with only long flag did not clear short flag #1248

Merged
merged 1 commit into from Apr 21, 2020

Conversation

shadowspawn
Copy link
Collaborator

Pull Request

Problem

Defining just a long flag would change the displayed help but leave the short flag defined and active.

const { program } = require('commander');
program.helpOption('--please');
program.parse();
$ node resetShort.js -h
... help displayed ...

Solution

Clear short flag in case not set.

Copy link
Collaborator

@abetomo abetomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@shadowspawn shadowspawn added the pending release Merged into a branch for a future release, but not released yet label Apr 21, 2020
@shadowspawn shadowspawn merged commit 56221f7 into tj:develop Apr 21, 2020
@shadowspawn shadowspawn deleted the feature/no-short-help-flag branch April 21, 2020 06:28
@shadowspawn shadowspawn removed the pending release Merged into a branch for a future release, but not released yet label Apr 25, 2020
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.

None yet

2 participants