fix(args): - can now be parsed as a value for an argument

Closes #121
This commit is contained in:
Kevin K 2015-05-17 09:45:16 -04:00
parent 8dd2150aae
commit bc12e78ead

View file

@ -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 {