Changelog History
Page 2
-
v2.2 Changes
March 27, 2022๐ New features include support for output of an empty vector, a summing option policy that can be applied more broadly, and an option to validate optional arguments to discriminate from positional arguments. A new validator to check 0๏ธโฃ for files on a default path is included to allow one or more default paths for ๐ง configuration files or other file arguments. A number of bug fixes and code ๐ cleanup for various build configurations. Clean up of some error outputs and extension of existing capability to new types or situations.
There is a possible minor breaking change in behavior of certain types which wrapped an integer, such as
std::atomic<int>orstd::optional<int>when used 0๏ธโฃ in a flag. The default behavior is now as a single argument value vs. summing 0๏ธโฃ all the arguments. The default summing behavior is now restricted to pure integral types, int64_t, int, uint32_t, etc. Use the newsummulti option โช policy to revert to the older behavior. The summing behavior on wrapper types was not originally intended.- โ Add
MultiOptionPolicy::Sumand refactor theadd_flagto fix a bug when usingstd::optional<bool>as type. #709 - โ Add support for an empty vector result in TOML and as a default string. #660
- Add
.validate_optional_arguments()to support discriminating positional arguments from vector option arguments. #668 - โ Add
CLI::FileOnDefaultPathto check for files on a specified default path. #698 - ๐ Change default value display in help messages from
=XXXXto[XXXXX]to make it clearer. #666 - ๐ Modify the Range Validator to support additional types and clean up the error output. #690
- ๐ Bugfix: The trigger on parse modifier did not work on positional argument.s #713
- ๐ Bugfix: The single header file generation was missing custom namespace generation. #707
- ๐ Bugfix: Clean up File Error handling in the argument processing. #678
- ๐ Bugfix: Fix a stack overflow error if nameless commands had fallthrough. #665
- ๐ Bugfix: A subcommand callback could be executed multiple times if it was a member of an option group. #666
- ๐ Bugfix: Fix an issue with vectors of multi argument types where partial argument sets did not result in an error. #661
- ๐ Bugfix: Fix an issue with type the template matching on C++20 and add some CI builds for C++20. #663
- ๐ Bugfix: Fix typo in C++20 detection on MSVC. #706
- ๐ Bugfix: An issue where the detection of RTTI being disabled on certain MSVC platforms did not disable the use of dynamic cast calls. #666
- ๐ Bugfix: Resolve strict-overflow warning on some GCC compilers. #666
- โ Backend: Add additional tests concerning the use of aliases for option groups in config files. #666
- ๐ Build: Add support for testing in meson and cleanup symbolic link generation. #701, #697
- ๐ Build: Support building in WebAssembly. #679
- โ Add
-
v2.1.3 Changes
- ๐ Change the way the default value is displayed in the included help text generation from
=XXXXXto[XXXXX]to clean up some situations in which the text looked awkward and unclear #666 - ๐ Fix a bug where a subcommand callback could be executed multiple times if it was a member of an option group #666
- ๐ Fix an issue where the detection of RTTI being disabled on certain visual studio platforms did not disable the use of dynamic cast calls #666
- โ Add additional tests concerning the use of aliases for option groups in config files #666
- โ Resolve strict-overflow warning on some GCC compilers #666
- ๐ Change the way the default value is displayed in the included help text generation from
-
v2.1.2 Changes
- ๐ Use
mainfor the main branch of the repository #657 - ๐ Bugfix(cmake): Enforce at least C++11 when using CMake target #656
- ๐ Build: Don't run doxygen and CTest includes if a submodule #656
- ๐ Build: Avoid a warning on CMake 3.22 #656
- ๐ Build: Support compiling the tests with an external copy of Catch2 #653
- ๐ Use
-
v2.1 Changes
The name restrictions for options and subcommands are now much looser, allowing a wider variety of characters than before, even spaces can be used (use quotes ๐ง to include a space in most shells). The default configuration parser was ๐ improved, allowing your configuration to sit in a larger file. And option callbacks have a few new settings, allowing them to be run even if the option is ๐ not passed, or every time the option is parsed.
- Option/subcommand name restrictions have been relaxed. Most characters are now allowed. #627
- ๐ The config parser can accept streams, specify a specific section, and inline comment characters are supported #630
force_callback&trigger_on_parseadded, allowing a callback to always run on parse even if not present or every time the option is parsed #631- ๐ Bugfix(cmake): Only add
CONFIGURE_DEPENDSif CLI11 is the main project #633 - ๐ Bugfix(cmake): Ensure the cmake/pkg-config files install to a arch independent path #635
- ๐ Bugfix: The single header file generation was missing the include guard. #620
-
v2.0 Changes
๐ This version focuses on cleaning up deprecated functionality, and some minor 0๏ธโฃ default changes. The config processing is TOML compliant now. Atomics and ๐ complex numbers are directly supported, along with other container improvements. A new version flag option has finally been added. Subcommands are significantly ๐ improved with new features and bugfixes for corner cases. This release contains โ a lot of backend cleanup, including a complete overhaul of the testing system and single file generation system.
- Built-in config format is TOML compliant now #435
- ๐ More powerful containers, support for
%%separator #423 - ๐ Support atomic types #520 and complex types natively #423
- โ Add a type validator
CLI::TypeValidator<TYPE>#526 - โ Add a version flag easily #452, with help message #601
- ๐ Support
->silent()on subcommands. #529 - โ Add alias section to help for subcommands #545
- ๐ Allow quotes to specify a program name #605
- Backend: redesigned MakeSingleFiles to have a higher level of manual control, to support future features. #546
- ๐ Backend: moved testing from GTest to Catch2 #574
- ๐ Bugfix: avoid duplicated and missed calls to the final callback #584
- ๐ Bugfix: support embedded newlines in more places #592
- ๐ Bugfix: avoid listing helpall as a required flag #530
- ๐ Bugfix: avoid a clash with WINDOWS define #563
- ๐ Bugfix: the help flag didn't get processed when a config file was required #606
- ๐ Bugfix: fix description of non-configurable subcommands in config #604
- ๐ Build: support pkg-config #523
Converting from CLI11 1.9
๐ > - Removed deprecated set commands, use validators instead. #565 0๏ธโฃ > - The final "defaulted" bool has been removed, use
->capture_default_str()0๏ธโฃ > instead. Useapp.option_defaults()->always_capture_default()to set this for all future options. #597- Use
add_optionon a complex number instead ofadd_complex, which has ๐ > been removed.
-
v1.9.1 Changes
June 20, 2020๐ This is a patch version that backports fixes from the development of 2.0.
- ๐ Support relative inclusion #475
- ๐ Fix cases where spaces in paths could break CMake support #471
- ๐ Fix an issue with string conversion #421
- Cross-compiling improvement for Conan.io #430
- ๐ Fix option group default propagation #450
- ๐ Fix for C++20 #459
- ๐ Support compiling with RTTI off #461
-
v1.9 Changes
๐ Config file handling was revamped to fix common issues, and now supports reading TOML.
โ Adding options is significantly more powerful with support for things like
std::tupleandstd::array, including with transforms. Several new ๐ง configuration options were added to facilitate a wider variety of apps. GCC 4.7 ๐ is no longer supported.- ๐จ Config files refactored, supports TOML (may become default output in 2.0) #362
- โ Added two template parameter form of
add_option, allowingstd::optionalto be supported without a special import #285 - ๐
string_viewnow supported in reasonable places #300, #285 immediate_callback,final_callback, andparse_complete_callbackadded to support controlling the App callback order #292, #313- Multiple positional arguments maintain order if
positionals_at_endis set. #306 - ๐ Pair/tuple/array now supported, and validators indexed to specific components in the objects #307, #310
- ๐ Footer callbacks supported #309
- ๐ Subcommands now support needs (including nameless subcommands) #317
- More flexible type size, more useful
add_complex#325, #370 - โ Added new validators
CLI::NonNegativeNumberandCLI::PositiveNumber#342 - ๐ Transform now supports arrays #349
- Option groups can be hidden #356
- Add
CLI::deprecate_optionandCLI::retire_optionfunctions #358 - 0๏ธโฃ More flexible and safer Option
default_val#387 - Backend: Cleaner type traits #286
- โก๏ธ Backend: File checking updates #341
- Backend: Using pre-commit to format, checked in GitHub Actions #336
- Backend: Clang-tidy checked again, CMake option now
CL11_CLANG_TIDY#390 - โ Backend: Warning cleanup, more checks from klocwork #350, Effective C++ #354, clang-tidy #360, CUDA NVCC #365, cross compile #373, sign conversion #382, and cpplint #400
- ๐ Docs: CLI11 Tutorial now hosted in the same repository #304, #318, #374
- ๐ Bugfix: Fixed undefined behavior in
checked_multiply#290 - ๐ Bugfix:
->check()was adding the name to the wrong validator #320 - ๐ Bugfix: Resetting config option works properly #301
- ๐ Bugfix: Hidden flags were showing up in error printout #333
- ๐ Bugfix: Enum conversion no longer broken if stream operator added #348
- ๐ท Build: The meson build system supported #299
- ๐ Build: GCC 4.7 is no longer supported, due mostly to GoogleTest. GCC 4.8+ is now required. #160
- ๐ท Build: Restructured significant portions of CMake build system #394
Converting from CLI11 1.8
๐ > - Some deprecated methods dropped
add_set*should be replaced with->check/->transformandCLI::IsMembersince 1.8 0๏ธโฃ > -get_defaultvalwas replaced byget_default_strin 1.8 ๐ > - The true/false 4th argument toadd_optionis expected to be removed in 0๏ธโฃ > 2.0, use->capture_default_str()since 1.8
-
v1.8.0 Changes
May 20, 2019Set handling has been completely replaced by a new backend that works as a Validator or Transformer. This provides a single interface instead of the 16 different functions in App. It also allows ordered collections to be used, custom functions for filtering, and better help and error messages. You can also use a collection of pairs (like
std::map) to transform the match into an output. Also new are inverted flags, which can cancel or reduce the count of flags, and can also support general flag types. A newadd_option_fnlets you more easily program CLI11 options with the types you choose. Vector options now support a custom separator. Apps can now be composed with unnamed subcommand support. The final bool "defaults" flag when creating options has been replaced by->capture_default_str()(ending an old limitation in construction made this possible); the old method is still available but may be removed in future versions.- Replaced default help capture:
.add_option("name", value, "", True)becomes.add_option("name", value)->capture_default_str()#242 - Added
.always_capture_default()#242 - ๐ New
CLI::IsMembervalidator replaces set validation #222 - ๐ IsMember also supports container of pairs, transform allows modification of result #228
- โ Added new Transformers,
CLI::AsNumberWithUnitandCLI::AsSizeValue#253 - Much more powerful flags with different values #211, general types #235
- ๐
add_optionnow supports bool due to unified bool handling #211 - ๐ Support for composable unnamed subcommands #216
- Reparsing is better supported with
.remaining_for_passthrough()#265 - Custom vector separator using
->delimiter(char)#209, #221, #240 - Validators added for IP4 addresses and positive numbers #210 and numbers #262
- Minimum required Boost for optional Optionals has been corrected to 1.61 #226
- Positionals can stop options from being parsed with
app.positionals_at_end()#223 - โ Added
validate_positionals#262 - ๐ Positional parsing is much more powerful #251, duplicates supported []#247]
- Validators can be negated with
!#230, and now handle tname functions #228 - ๐ Better enum support and streaming helper #233 and #228
- โ Cleanup for shadow warnings #232
- ๐ Better alignment on multiline descriptions #269
- ๐ Better support for aarch64 #266
- โ
Respect
BUILD_TESTINGonly if CLI11 is the main project; otherwise,CLI11_TESTINGmust be used #277 - โฌ๏ธ Drop auto-detection of experimental optional and boost::optional; must be enabled explicitly (too fragile) #277 #279
Converting from CLI11 1.7:
.add_option(..., true)should be replaced by.add_option(...)->capture_default_str()orapp.option_defaults()->always_capture_default()can be usedapp.add_set("--name", value, {"choice1", "choice2"})should becomeapp.add_option("--name", value)->check(CLI::IsMember({"choice1", "choice2"}))- The
_ignore_caseversion of this can be replaced by addingCLI::ignore_caseto the argument list inIsMember - The
_ignore_underscoreversion of this can be replaced by addingCLI::ignore_underscoreto the argument list inIsMember - The
_ignore_case_underscoreversion of this can be replaced by adding both functions listed above to the argument list inIsMember - If you want an exact match to the original choice after one of the modifier functions matches, use
->transforminstead of->check - The
_mutableversions of this can be replaced by passing a pointer or shared pointer intoIsMember - An error with sets now produces a
ValidationErrorinstead of aConversionError
- Replaced default help capture:
-
v1.7.1 Changes
January 30, 2019