From 45753d552b166f81a63924baa144ee3f83ca223b Mon Sep 17 00:00:00 2001 From: Donough Liu Date: Wed, 30 Dec 2020 02:13:36 +0800 Subject: [PATCH] Resolve a TODO --- src/parse/arg_matcher.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parse/arg_matcher.rs b/src/parse/arg_matcher.rs index e4a520be6c5..88fca8c4211 100644 --- a/src/parse/arg_matcher.rs +++ b/src/parse/arg_matcher.rs @@ -130,7 +130,10 @@ impl ArgMatcher { pub(crate) fn add_val_to(&mut self, arg: &Id, val: OsString, ty: ValueType) { let ma = self.entry(arg).or_insert(MatchedArg { - occurs: 0, // @TODO @question Shouldn't this be 1 if we're already adding a value to this arg? + // We will manually inc occurrences later(for flexibility under + // specific circumstances, like only add one occurrence for flag + // when we met: `--flag=one,two`). + occurs: 0, ty, indices: Vec::with_capacity(1), vals: Vec::with_capacity(1),