Releases: SpectraL519/cpp-ap
v2.1.0
- Added the
argument_parser::verbosefunction which can be used to set the description verbosity mode - Aligned the argument description generating to:
- Align the argument help messages (when verbose=false)
- Print the argument parameter values (when verbose=true)
- Added missing file doc comments
v1.2
- Added the
demoworkflow - Cleanup of the scripts, CMake and workflow files
- Improved error logic for argument value getting
Fixed the
v1.2tag which addressed an invalid commit hash
v2.0.2
Added the argument name verification functionality to the argument_parser class - an error is thrown if argument_parser::add_* is called with a name that:
- is empty
- begins with the flag prefix character
- begins with a digit
v2.0.1
Doxyfilecleanup- Extracted the
tutorialanddev notessections from readme to separate files - Added the v2 changelog file
- Added the
documentationworkflow - Aligned the current workflows to be triggered on PRs to master
v2.0.0
The Structure
The v2 version of the library no longer uses a single-header approach, however it is still a header-only library. With this change it is now required to download the entire library - either with CMake or from the releases page.
Range-based Approach
Aligned functions to use a generic range-based approach, which allows for more flexibility in using the library.
| Function | Description |
|---|---|
argument_parser::parse_args( |
New Parses the command-line arguments passed through a range of string-convertible objects.NOTE: The parse_args(argc, argv) function is still available. |
argument::positional::choices( |
Aligned Sets the choices parameter of a positional argument.NOTE: Previously the function used std::vector<value_type>. |
argument::positional::choices( |
New Sets the choices parameter of a positional argument using a range of value_type-convertible objects. |
argument::optional::choices( |
Aligned Sets the choices parameter of an optional argument.NOTE: Previously the function used std::vector<value_type>. |
argument::optional::choices( |
New Sets the choices parameter of an optional argument using a range of value_type-convertible objects. |
New Utility Functions
Added utility functions to the argument_parser class that encapsulate common behavior, reducing the need to write boilerplate code and simplifying the argument-parsing logic.
| Function | Description |
|---|---|
void try_parse_args(int argc, char* argv[]) |
Parses the command-line arguments and, in case of an error, prints the error message and exits with a failure status. |
void handle_help_action() |
Checks the value of the help boolean flag argument and exits with success status if the value is true. |
T value_or<T, U>( |
Returns the argument's value if possible and default_value otherwise. |
A more detailed explanation of these functions is available in the Tutorial section.
v1.1
CPP-AP: version 1.1
- Introduced CMake integration
- Formatting scripts improvement
- Small code refactor including:
argument_nameclass refactor- Added aliases for default positional and optional arguments discriminator structures
- Utilizing the
std::rangeslibrary for operations on collections
- Cleaned the commit history
v1.0
Initial library release