Version 1.3: Refactor
This version focused on refactoring several key systems to ensure correct behavior in the interaction of different settings. Most caveats about features only working on the main App have been addressed, and extra arguments have been reworked. Inheritance of defaults makes configuring CLI11 much easier without having to subclass. Policies add new ways to handle multiple arguments to match your favorite CLI programs. Error messages and help messages are better and more flexible. Several bugs and odd behaviors in the parser have been fixed.
- Added a version macro,
CLI11_VERSION
, along with*_MAJOR
,*_MINOR
, and*_PATCH
, for programmatic access to the version. - Reworked the way defaults are set and inherited; explicit control given to user with
->option_defaults()
#48 - Hidden options now are based on an empty group name, instead of special "hidden" keyword #48
parse
no longer returns (soCLI11_PARSE
is always usable) #37- Added
remaining()
andremaining_size()
#37 allow_extras
andprefix_command
are now valid on subcommands #37- Added
take_last
to only take last value passed #40 - Added
multi_option_policy
and shortcuts to provide more control than just a take last policy #59 - More detailed error messages in a few cases #41
- Footers can be added to help #42
- Help flags are easier to customize #43
- Subcommand now support groups #46
CLI::RuntimeError
added, for easy exit with error codes #45- The clang-format script is now no longer "hidden" #48
- The order is now preserved for subcommands (list and callbacks) #49
- Tests now run individually, utilizing CMake 3.10 additions if possible #50
- Failure messages are now customizable, with a shorter default #52
- Some improvements to error codes #53
require_subcommand
now offers a two-argument form and negative values on the one-argument form are more useful #51- Subcommands no longer match after the max required number is obtained #51
- Unlimited options no longer prioritize over remaining/unlimited positionals #51
- Added
->transform
which modifies the string parsed #54 - Changed of API in validators to
void(std::string &)
(const for users), throwing providing nicer errors #54 - Added
CLI::ArgumentMismatch
#56 and fixed missing failure if one arg expected #55 - Support for minimum unlimited expected arguments #56
- Single internal arg parse function #56
- Allow options to be disabled from INI file, rename
add_config
toset_config
#60
Converting from CLI11 1.2:
app.parse
no longer returns a vector. Instead, useapp.remaining(true)
."hidden"
is no longer a special group name, instead use""
- Validators API has changed to return an error string; use
.empty()
to get the old bool back- Use
.set_help_flag
instead of accessing the help pointer directly (discouraged, but not removed yet)add_config
has been renamed toset_config
- Errors thrown in some cases are slightly more specific