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

Strange behavior when using AllowLeadingHyphen #588

Closed
yodalee opened this issue Jul 22, 2016 · 2 comments
Closed

Strange behavior when using AllowLeadingHyphen #588

yodalee opened this issue Jul 22, 2016 · 2 comments
Labels
A-parsing Area: Parser's logic and needs it changed somehow. C-bug Category: Updating dependencies
Milestone

Comments

@yodalee
Copy link

yodalee commented Jul 22, 2016

I'm trying to using clap-rs to build the interface of chmod. chmod accepts arguments like -rwx +0700, These are not real arguments so we cannot add them to arguments.
I try to setting like this:

.setting(AppSettings::AllowLeadingHyphen)
.arg(Arg::with_name("mode"))
.arg(Arg::with_name("debug").long("debug").short("d").help("open debug mode"))

with this will give error:

$ claptest -rwx -d`
error: Found argument '-d' which wasn't expected, or isn't valid in this context

Not sure how to set this correctly.

@kbknapp
Copy link
Member

kbknapp commented Jul 23, 2016

This is a bug. Let me look into it a little deeper and I'll post back here with some findings. Thanks for filing this!

@kbknapp kbknapp added C-bug Category: Updating dependencies P2: need to have A-parsing Area: Parser's logic and needs it changed somehow. labels Jul 23, 2016
@kbknapp kbknapp added this to the 2.12.0 milestone Sep 12, 2016
@kbknapp
Copy link
Member

kbknapp commented Sep 13, 2016

Sorry this took so long to fix, it's fixed in #660 and will be uploaded to crates.io shortly as v2.12.0

@homu homu closed this as completed in a9699e4 Sep 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parsing Area: Parser's logic and needs it changed somehow. C-bug Category: Updating dependencies
Projects
None yet
Development

No branches or pull requests

2 participants