summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLib/testArgumentParser.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Revise C++ coding style using clang-format-15Kitware Robot2023-01-181-1/+1
| | | | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 15. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit. Fixes: #24315
* cmArgumentParser: Ignore positional after keywordMatthew Woehlke2022-08-171-6/+15
| | | | | | | | | Tweak cmArgumentParser to ignore positional arguments once a keyword argument has been seen. This prevents mingling of keyword arguments being able to effectively skip positional arguments, with later arguments being picked up again; this seems highly likely to lead to user confusion. This is also consistent with how other languages (e.g. Python) handle a mix of "named" and positional arguments.
* cmArgumentParser: Model non-empty strings with wrapper typeBrad King2022-07-281-0/+16
| | | | | | Some clients have been explicitly checking whether the string specified after a keyword is empty. Offer them a way to specify that the string must be non-empty as part of the binding type.
* cmArgumentParser: Offer bindings for positional argumentsBrad King2022-07-271-0/+7
|
* cmArgumentParser: Add callback bindingsBrad King2022-07-271-3/+110
|
* cmArgumentParser: Propagate constructors through binding wrapper typesBrad King2022-07-271-0/+14
|
* cmArgumentParser: Offer binding for list of parsed keywordsBrad King2022-07-251-0/+23
| | | | | Some clients ask for this list in their `Parse()` call. Offer them a way to express this request as a binding.
* cmArgumentParser: Drop unused keywordsMissingValue argument to Parse()Brad King2022-07-251-17/+7
| | | | | All clients have been converted to encoding this requirement in their bindings.
* cmArgumentParser: Capture keyword errors in parse resultsBrad King2022-07-221-2/+16
| | | | | | | | | Since commit f46b2e9142 (cmArgumentParser: Model maybe-missing string with wrapper type, 2022-07-06) we know during parsing whether or not it is an error for a keyword to be missing a value. Record such errors in the parse results structure. Offer clients a helper method to report them. This provides clients with an alternative to manually checking `keywordsMissingValue` and generating their own error message.
* cmArgumentParser: Add structure to capture operational resultsBrad King2022-07-221-39/+57
| | | | | | | Create a way for the parser to record errors or incidental information about the argument parsing operation that clients can inspect afterward. Offer clients a way to hold the structure as part of their arguments structure.
* cmArgumentParser: Model maybe-missing string with wrapper typeBrad King2022-07-071-0/+5
| | | | | | Bindings to `std::string` require one value. Some clients have been filtering `keywordsMissingValue` to support keywords that tolerate a missing value. Offer them a type-safe way to achieve this instead.
* cmArgumentParser: Model maybe-empty and non-empty lists with wrapper typesBrad King2022-07-071-5/+12
| | | | | | | | 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.
* cmArgumentParser: Offer cm::optional bindings to capture keyword presenceBrad King2022-07-051-11/+38
| | | | | | Several clients have been using `keywordsMissingValue` or `parsedKeywords` to check for the presence of keywords. Offer them a type-encoded way to explicitly check whether a keyword is present.
* cmArgumentParser: Avoid allocating copies of keyword stringsBrad King2022-07-051-4/+5
|
* Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view>Marc Chevrier2020-04-301-2/+1
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-5/+6
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-1/+1
| | | | | | | | | | | | | | Provide a standardized way to handle the C++ "standard" headers customized to be used with current CMake C++ standard constraints. Offer under directory `cm` headers which can be used as direct replacements of the standard ones. For example: #include <cm/string_view> can be used safely for CMake development in place of the `<string_view>` standard header. Fixes: #19491
* Introduce cmArgumentParserRegina Pfeifer2019-04-041-0/+148