summaryrefslogtreecommitdiff
path: root/Source/cmArgumentParser.h
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2019-09-20 13:27:02 +0200
committerRegina Pfeifer <regina@mailbox.org>2019-09-20 13:27:30 +0200
commitd5a6a133680e4d5798522a4b29ae6bced1f2db3a (patch)
treec6df13c4538c99c12b003f5bbc27e0d150f1ae57 /Source/cmArgumentParser.h
parent75b2c9717c0a8e850f524c7d70f4aaa6d224e404 (diff)
downloadcmake-d5a6a133680e4d5798522a4b29ae6bced1f2db3a.tar.gz
cmArgumentParser: Record parsed keywords
Diffstat (limited to 'Source/cmArgumentParser.h')
-rw-r--r--Source/cmArgumentParser.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/Source/cmArgumentParser.h b/Source/cmArgumentParser.h
index 6cfe946336..e1773b487e 100644
--- a/Source/cmArgumentParser.h
+++ b/Source/cmArgumentParser.h
@@ -45,7 +45,8 @@ public:
void Consume(cm::string_view arg, void* result,
std::vector<std::string>* unparsedArguments,
- std::vector<std::string>* keywordsMissingValue);
+ std::vector<std::string>* keywordsMissingValue,
+ std::vector<std::string>* parsedKeywords);
private:
ActionMap const& Bindings;
@@ -79,21 +80,25 @@ public:
template <typename Range>
void Parse(Result& result, Range const& args,
std::vector<std::string>* unparsedArguments = nullptr,
- std::vector<std::string>* keywordsMissingValue = nullptr) const
+ std::vector<std::string>* keywordsMissingValue = nullptr,
+ std::vector<std::string>* parsedKeywords = nullptr) const
{
ArgumentParser::Instance instance(this->Bindings);
for (cm::string_view arg : args) {
- instance.Consume(arg, &result, unparsedArguments, keywordsMissingValue);
+ instance.Consume(arg, &result, unparsedArguments, keywordsMissingValue,
+ parsedKeywords);
}
}
template <typename Range>
Result Parse(Range const& args,
std::vector<std::string>* unparsedArguments = nullptr,
- std::vector<std::string>* keywordsMissingValue = nullptr) const
+ std::vector<std::string>* keywordsMissingValue = nullptr,
+ std::vector<std::string>* parsedKeywords = nullptr) const
{
Result result;
- this->Parse(result, args, unparsedArguments, keywordsMissingValue);
+ this->Parse(result, args, unparsedArguments, keywordsMissingValue,
+ parsedKeywords);
return result;
}
@@ -116,11 +121,13 @@ public:
template <typename Range>
void Parse(Range const& args,
std::vector<std::string>* unparsedArguments = nullptr,
- std::vector<std::string>* keywordsMissingValue = nullptr) const
+ std::vector<std::string>* keywordsMissingValue = nullptr,
+ std::vector<std::string>* parsedKeywords = nullptr) const
{
ArgumentParser::Instance instance(this->Bindings);
for (cm::string_view arg : args) {
- instance.Consume(arg, nullptr, unparsedArguments, keywordsMissingValue);
+ instance.Consume(arg, nullptr, unparsedArguments, keywordsMissingValue,
+ parsedKeywords);
}
}