Skip to content

Commit

Permalink
fix(args): - can now be parsed as a value for an argument
Browse files Browse the repository at this point in the history
Closes #121
  • Loading branch information
kbknapp committed May 17, 2015
1 parent 8dd2150 commit bc12e78
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,12 @@ impl<'a, 'v, 'ab, 'u, 'h, 'ar> App<'a, 'v, 'ab, 'u, 'h, 'ar>{
while let Some(arg) = it.next() {
let arg_slice = &arg[..];
let mut skip = false;
if !pos_only && !arg_slice.starts_with("-") && !self.subcommands.contains_key(arg_slice) {
let new_arg = if arg_slice.starts_with("-") {
if arg_slice.len() == 1 { false } else { true }
} else {
false
};
if !pos_only && !new_arg && !self.subcommands.contains_key(arg_slice) {
if let Some(nvo) = needs_val_of {
if let Some(ref opt) = self.opts.get(nvo) {
if let Some(ref p_vals) = opt.possible_vals {
Expand Down

0 comments on commit bc12e78

Please sign in to comment.