Skip to content

Commit

Permalink
fix(Options): fixes a bug where option arguments in succession get th…
Browse files Browse the repository at this point in the history
…eir values skipped
  • Loading branch information
kbknapp committed May 3, 2015
1 parent 0b165e2 commit f66334d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,16 @@ impl<'a, 'v, 'ab, 'u, 'h, 'ar> App<'a, 'v, 'ab, 'u, 'h, 'ar>{
if skip {
needs_val_of = None;
continue;
} else if let Some(ref name) = needs_val_of {
if let Some(ref o) = self.opts.get(name) {
if !o.multiple {
self.report_error(
format!("Argument '{}' requires a value but none was supplied", o),
true,
true,
Some(matches.args.keys().map(|k| *k).collect::<Vec<_>>() ) );
}
}
}

if arg_slice.starts_with("--") && !pos_only {
Expand Down

0 comments on commit f66334d

Please sign in to comment.