summaryrefslogtreecommitdiffstats
path: root/Source/cmArgumentParser.h
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2019-09-26 13:22:00 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-09-26 13:22:13 (GMT)
commit67e6b55c5885c445b5b78b41a66529553dcab069 (patch)
treeb81531ae84bc02bfe7abe2e3c93fcaf4eb705dfb /Source/cmArgumentParser.h
parentb42cb1ff80dc056da4036c7b65109d1a77d84bf4 (diff)
parent0aa8a2ab8b00c0889df3d0fa1be47ad5a0b9db22 (diff)
downloadCMake-67e6b55c5885c445b5b78b41a66529553dcab069.zip
CMake-67e6b55c5885c445b5b78b41a66529553dcab069.tar.gz
CMake-67e6b55c5885c445b5b78b41a66529553dcab069.tar.bz2
Merge topic 'ctest-argument-parser'
0aa8a2ab8b cmCTest*Command: Port to cmArgumentParser d5a6a13368 cmArgumentParser: Record parsed keywords Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3835
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 b6798bc..9be2488 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);
}
}