Skip to content

Commit 9af52e9

Browse files
committed
fix(option): fix bug with option occurrence values
1 parent d8f03a5 commit 9af52e9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,8 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
483483
if let Some(ref opt) = self.opts.get(nvo) {
484484
if let Some(ref mut o) = matches.opts.get_mut(opt.name) {
485485
o.values.push(arg.clone());
486-
o.occurrences = if opt.multiple { o.occurrences + 1 } else { 1 };
486+
// if it's multiple the occurrences are increased when originall found
487+
o.occurrences = if opt.multiple { o.occurrences } else { 1 };
487488
}
488489

489490
skip = true;

0 commit comments

Comments
 (0)