summaryrefslogtreecommitdiffstats
path: root/Source/cmArgumentParser.h
Commit message (Collapse)AuthorAgeFilesLines
* cmArgumentParser: Capture keyword errors in parse resultsBrad King2022-07-221-1/+19
| | | | | | | | | 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-9/+41
| | | | | | | 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: Store keyword action map with explicit nameBrad King2022-07-221-7/+15
|
* cmArgumentParser: Factor out common static/dynamic implementationBrad King2022-07-221-29/+32
|
* cmArgumentParser: Track pending keyword explicitlyBrad King2022-07-201-0/+3
| | | | Avoid allocating missing keyword vector unnecessarily.
* cmArgumentParser: De-duplicate parse loopBrad King2022-07-201-7/+11
|
* cmArgumentParser: Simplify internal method signaturesBrad King2022-07-201-18/+35
| | | | | Record `Parse` parameters during construction of the internal instance instead of passing them to every method.
* cmArgumentParser: Model maybe-missing string with wrapper typeBrad King2022-07-071-0/+1
| | | | | | 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-1/+4
| | | | | | | | 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-0/+11
| | | | | | 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: Remove unnecessary local names for common typesBrad King2022-07-051-6/+3
|
* cmArgumentParser: Require callers to consider unparsed argumentsBrad King2022-07-051-5/+3
|
* cmArgumentParser: Avoid allocating copies of keyword stringsBrad King2022-07-051-8/+8
|
* Modernize: Use #pragma once in all header filesKitware Robot2020-09-031-4/+1
| | | | | | | | | | | | | | | | #pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
* 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-3/+4
| | | | | 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.
* Merge topic 'ctest-argument-parser'Kyle Edwards2019-09-261-7/+14
|\ | | | | | | | | | | | | | | 0aa8a2ab8b cmCTest*Command: Port to cmArgumentParser d5a6a13368 cmArgumentParser: Record parsed keywords Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3835
| * cmArgumentParser: Record parsed keywordsRegina Pfeifer2019-09-201-7/+14
| |
* | 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/+143