mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 14:54:15 +00:00
fix(option): fix bug with option occurrence values
This commit is contained in:
parent
d8f03a55c4
commit
9af52e93ce
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue