summaryrefslogtreecommitdiffstats
path: root/Source/cmCommandLineArgument.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCommandLineArgument.h')
-rw-r--r--Source/cmCommandLineArgument.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmCommandLineArgument.h b/Source/cmCommandLineArgument.h
index 16564dd..cbedf0a 100644
--- a/Source/cmCommandLineArgument.h
+++ b/Source/cmCommandLineArgument.h
@@ -14,6 +14,7 @@ struct cmCommandLineArgument
One,
Two,
ZeroOrOne,
+ OneOrMore
};
std::string InvalidSyntaxMessage;
@@ -129,6 +130,23 @@ struct cmCommandLineArgument
: ParseMode::Invalid;
}
}
+ } else if (this->Type == Values::OneOrMore) {
+ if (input.size() == this->Name.size()) {
+ auto nextValueIndex = index + 1;
+ if (nextValueIndex >= allArgs.size() || allArgs[index + 1][0] == '-') {
+ parseState = ParseMode::ValueError;
+ } else {
+ std::string buffer = allArgs[nextValueIndex++];
+ while (nextValueIndex < allArgs.size() &&
+ allArgs[nextValueIndex][0] != '-') {
+ buffer = cmStrCat(buffer, ";", allArgs[nextValueIndex++]);
+ }
+ parseState =
+ this->StoreCall(buffer, std::forward<CallState>(state)...)
+ ? ParseMode::Valid
+ : ParseMode::Invalid;
+ }
+ }
}
if (parseState == ParseMode::SyntaxError) {