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

fix: hide hidden options from help output even if they are in a group #1221

Merged
merged 1 commit into from Oct 6, 2018

Conversation

pvdlg
Copy link
Contributor

@pvdlg pvdlg commented Oct 2, 2018

require('yargs')
.options({
  foo: {
    describe: 'FOO',
    group: 'Hidden',
    hidden: true
  },
  baz: {
    describe: 'BAZ',
    group: 'Hidden',
    hidden: true
  }
})
  .help()
  .argv

Before:

Hidden
  --foo  FOO
  --baz  BAZ

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]

After:

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]

Copy link
Member

@bcoe bcoe left a comment

Choose a reason for hiding this comment

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

this looks good to me, definitely feels like a bug.

test/usage.js Show resolved Hide resolved
@bcoe bcoe merged commit da54028 into yargs:master Oct 6, 2018
@pvdlg pvdlg deleted the hidden-groups branch October 6, 2018 18:56
@bcoe
Copy link
Member

bcoe commented Oct 6, 2018

@pvdlg please try npm i yargs@next which should have your patch; let me know if there are any issues.

@pvdlg
Copy link
Contributor Author

pvdlg commented Oct 7, 2018

It works as expected, 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.

None yet

2 participants