mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
fix(AllowLeadingHyphen): fixes an issue where isn't ignored like it should be with this setting
Prior to this fix, using `AppSettings::AllowLeadingHyphen` wouldn't properly ignore `--` Closes #558
This commit is contained in:
parent
cb251de25c
commit
96c24c9a8f
1 changed files with 5 additions and 1 deletions
|
@ -586,7 +586,9 @@ impl<'a, 'b> Parser<'a, 'b>
|
|||
}
|
||||
|
||||
needs_val_of = try!(self.parse_long_arg(matcher, &arg_os));
|
||||
continue;
|
||||
if !(needs_val_of.is_none() && self.is_set(AppSettings::AllowLeadingHyphen)) {
|
||||
continue;
|
||||
}
|
||||
} else if arg_os.starts_with(b"-") && arg_os.len_() != 1 {
|
||||
needs_val_of = try!(self.parse_short_arg(matcher, &arg_os));
|
||||
if !(needs_val_of.is_none() && self.is_set(AppSettings::AllowLeadingHyphen)) {
|
||||
|
@ -1175,6 +1177,8 @@ impl<'a, 'b> Parser<'a, 'b>
|
|||
// Handle conflicts, requirements, etc.
|
||||
arg_post_processing!(self, flag, matcher);
|
||||
|
||||
return Ok(None);
|
||||
} else if self.is_set(AppSettings::AllowLeadingHyphen) {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue