summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-07-06 15:30:22 (GMT)
committerBrad King <brad.king@kitware.com>2022-07-07 13:48:58 (GMT)
commite6d1e29ffa6bd3141a769d1281f3407ed0774139 (patch)
tree667e168e1643d72da6c88433c3c71a26c4fdcb0e /Source/CTest
parent4c50f639c7e67098eba14bc41869dd5c354d0da6 (diff)
downloadCMake-e6d1e29ffa6bd3141a769d1281f3407ed0774139.zip
CMake-e6d1e29ffa6bd3141a769d1281f3407ed0774139.tar.gz
CMake-e6d1e29ffa6bd3141a769d1281f3407ed0774139.tar.bz2
cmArgumentParser: Model maybe-empty and non-empty lists with wrapper types
Previously bindings to `std::vector<std::string>` required at least one value. Some clients have been filtering `keywordsMissingValue` to support keywords followed by empty lists. Instead, require clients to specify whether a keyword's list can be empty as part of the binding type.
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestCoverageCommand.h3
-rw-r--r--Source/CTest/cmCTestSubmitCommand.h7
-rw-r--r--Source/CTest/cmCTestUploadCommand.h3
3 files changed, 8 insertions, 5 deletions
diff --git a/Source/CTest/cmCTestCoverageCommand.h b/Source/CTest/cmCTestCoverageCommand.h
index dc8f71e..55c68b2 100644
--- a/Source/CTest/cmCTestCoverageCommand.h
+++ b/Source/CTest/cmCTestCoverageCommand.h
@@ -11,6 +11,7 @@
#include <cm/memory>
#include <cm/optional>
+#include "cmArgumentParserTypes.h" // IWYU pragma: keep
#include "cmCTestHandlerCommand.h"
#include "cmCommand.h"
@@ -44,5 +45,5 @@ protected:
void BindArguments() override;
cmCTestGenericHandler* InitializeHandler() override;
- cm::optional<std::vector<std::string>> Labels;
+ cm::optional<ArgumentParser::MaybeEmpty<std::vector<std::string>>> Labels;
};
diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h
index 903bb64..b67f182 100644
--- a/Source/CTest/cmCTestSubmitCommand.h
+++ b/Source/CTest/cmCTestSubmitCommand.h
@@ -10,6 +10,7 @@
#include <cm/optional>
+#include "cmArgumentParserTypes.h"
#include "cmCTestHandlerCommand.h"
class cmCommand;
@@ -50,7 +51,7 @@ protected:
std::string RetryDelay;
std::string SubmitURL;
- cm::optional<std::vector<std::string>> Files;
- std::vector<std::string> HttpHeaders;
- cm::optional<std::vector<std::string>> Parts;
+ cm::optional<ArgumentParser::MaybeEmpty<std::vector<std::string>>> Files;
+ ArgumentParser::MaybeEmpty<std::vector<std::string>> HttpHeaders;
+ cm::optional<ArgumentParser::MaybeEmpty<std::vector<std::string>>> Parts;
};
diff --git a/Source/CTest/cmCTestUploadCommand.h b/Source/CTest/cmCTestUploadCommand.h
index 0dad2bf..a9d1dd2 100644
--- a/Source/CTest/cmCTestUploadCommand.h
+++ b/Source/CTest/cmCTestUploadCommand.h
@@ -10,6 +10,7 @@
#include <cm/memory>
+#include "cmArgumentParserTypes.h"
#include "cmCTestHandlerCommand.h"
#include "cmCommand.h"
@@ -45,5 +46,5 @@ protected:
void CheckArguments() override;
cmCTestGenericHandler* InitializeHandler() override;
- std::vector<std::string> Files;
+ ArgumentParser::MaybeEmpty<std::vector<std::string>> Files;
};