fix(option): fix bug with option occurrence values

This commit is contained in:
Kevin K 2015-03-26 14:51:14 -04:00
parent d8f03a55c4
commit 9af52e93ce

View file

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