Skip to content

Commit

Permalink
fix(option): fix bug with option occurrence values
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed Apr 1, 2015
1 parent d8f03a5 commit 9af52e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,8 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
if let Some(ref opt) = self.opts.get(nvo) {
if let Some(ref mut o) = matches.opts.get_mut(opt.name) {
o.values.push(arg.clone());
o.occurrences = if opt.multiple { o.occurrences + 1 } else { 1 };
// if it's multiple the occurrences are increased when originall found
o.occurrences = if opt.multiple { o.occurrences } else { 1 };
}

skip = true;
Expand Down

0 comments on commit 9af52e9

Please sign in to comment.