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

help_short() allows conflict option #1532

Closed
maicallist opened this issue Aug 22, 2019 · 1 comment · Fixed by #1797
Closed

help_short() allows conflict option #1532

maicallist opened this issue Aug 22, 2019 · 1 comment · Fixed by #1797
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-bug Category: Updating dependencies
Milestone

Comments

@maicallist
Copy link

maicallist commented Aug 22, 2019

Rust Version

rustc 1.37.0 (eae3437df 2019-08-13)C

Affected Version of clap

2.33.0

Bug or Feature Request Summary

help_short() allows conflict option.

Expected Behavior Summary

when setting arg with short(h) and help_short(h)
Clap should give an error about the conflict.

Actual Behavior Summary

Under App
pre-condition, App has a -h arg.

  1. when not setting help_short(), clap works as expected.
  2. when help_short("h") is set, -h option prints help info and lists -h is for two options.

Screen Shot 2019-08-23 at 10 31 08

Under Subcommand
pre-condition, subcommand has -h arg.

  1. when not setting help_short(), clap works as expected.
  2. when help_short("h") is set, -h option prints nothing and --help lists that -h is for two options.

Screen Shot 2019-08-23 at 10 20 19

@maicallist maicallist changed the title '-h' option under subcommand not working as expected help_short() allows conflict option Aug 23, 2019
@CreepySkeleton CreepySkeleton added A-help Area: documentation, including docs.rs, readme, examples, etc... P2: need to have C-bug Category: Updating dependencies labels Feb 1, 2020
@CreepySkeleton CreepySkeleton added this to the 3.0 milestone Feb 1, 2020
@pksunkara
Copy link
Member

pksunkara commented Apr 9, 2020

NOTE: .help_short() has been changed to .mut_arg()

.mut_arg("help", |h| {
    h.short('H').long("help").help("Print help information")
})

@pksunkara pksunkara linked a pull request Apr 9, 2020 that will close this issue
@bors bors bot closed this as completed in #1797 Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-bug Category: Updating dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants