From 9af52e93cef9e17ac9974963f132013d0b97b946 Mon Sep 17 00:00:00 2001 From: Kevin K Date: Thu, 26 Mar 2015 14:51:14 -0400 Subject: [PATCH] fix(option): fix bug with option occurrence values --- src/app.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index 2a8fd997dbb..e586bdd4701 100644 --- a/src/app.rs +++ b/src/app.rs @@ -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;