Releases: CLIUtils/CLI11
v2.6.1
Patch fixing some compile issues in specific situations in the recent release,
and a potential segmentation fault from specially crafted config files
Added
- Added CI tests for install and package management on macos-arm64 #1238
Fixed
- Fixed incorrect links to validator examples. #1239
- Fixed incorrect inclusion of definition for extra validators #1238
- Fixed fuzz generated failure from crafted files introduced in recent release
#1238 - Removed some usage of static const std::string in inline function that had
potential memory issues when CLI11 is used with shared libraries, this likely
isn't a bug but the fix did result in smaller code size so was kept. #1244
v2.6.0
Version 2.6.0
This version adds finer grained control of when option callbacks are executed,
and further refinements in the help formatting. It also fixes a number of bugs
in type support and the ordering of options. The other major change is moving
Extra Validators to a new file which can be disabled for slightly faster
compilation if not used, and allowing additional future Validators to be easily
added.
Added
- Added option to align long options with a ratio via
long_option_alignment_ratioin the formatter. This allows more control over
help output formatting. #1185 - Added support for
std::string_viewin theas<T>method on options.
#1187 - Added flags on the formatter to disable formatting for the description and
footer, allowing custom formatting such as word art. #1150 - Added subcommand prefix matching as a modifier to
CLI::App. Also included an
example of close matching logic. #1152 - Added additional fuzzing mechanics, including fuzzing subcommands, and
improved handling of edge cases. #1170 - Added new tests for array options and fixed ambiguity between tuple and
container conversions. #1136 - Added ability to use rvalue references in
add_flagdescriptions. #1173 - Added CMake presets for default and tidy builds. #1181
- Added several validator examples and documentation #1192
- Added permission validators for files and directories #1203
- Added fine grained control for option callback priority, and in what order
options including help execute in the processing sequence. #1226 - Added github action to link with future testing is oss-fuzz #1225
Changed
- Moved several of the validators to
ExtraValidators.hppand
ExtraValidators_inl.hppfiles, The compilation of these nonessential
validators can be disabled by settingCLI11_DISABLE_EXTRA_VALIDATORSto
OFF. Future additional validators will be behind a compile flag
CLI11_ENABLE_EXTRA_VALIDATORS. All non-essential validators will be under
this option with version 3.0. #1192 - Updated processing order: requirements are now checked before callbacks,
avoiding unexpected side effects. #1186 - Updated minimum required CMake version to 3.14+. #1182
- Improved Meson build: support for building shared precompiled libraries,
pkgconfig, and header installation. #1167 - Improved fuzzing tests with new failure cases and extended coverage. #1164
- Updated CI to remove deprecated images and add new ones (Windows-2022/2025,
arm64, FreeBSD). #1172, #1178 - Updated license file to include the correct version number for packagers.
#1180
Fixed
- Fixed issue with IPV4 validator where it would allow a trailing
.. #1192 - Fixed edge case where a missing config file and no default caused a segfault.
#1199 - Fixed issue with TOML multiline arrays when the first line contained only a
single character. #1196 - Fixed default value conversion errors when locales added thousands separators.
#1160 - Fixed multiple footer printing in help output for option groups. #1161
- Fixed incorrect argument order in extras error messages. #1162
- Fixed reversed argument order in unexpected argument error messages. #1158
- Fixed ambiguity with
vector<array>options. #1147 - Fixed bug parsing negative floating point values without a leading zero.
#1140 - Fixed spelling mistake in
Error.hpp. #1129 - Fixed compilation issue with MSVC 2017. #1143
- Fixed issue with default strings of arrays in config output. #1155
- Fixed fuzzing issues with NaNs and certain error pathways. #1138
- Fixed fuzzer misinterpreting
--sub1.-as a short option. #1148 - Fixed issue where parse_order was not cleared on reset. #1218
- modify code to make compatible with /GR- option in MSVC #1206
- Fixed issue where the version flag would not take precedence over option
requirements #1226 - Fixed extra newlines being printed if a footer was in use #1229
Version 2.5.0: Formatter
This version add a new formatter with improved control capabilities and output aligned with standards for help output. It also add a modifier to enable use of non-standard option names. Along with several bug fixes for edge cases in string and config file parsing.
- Better help formatter #866, this better aligns the help generation with UNIX standard and allows use in help2man. #1093
- Add mechanism to allow option groups to be hidden and all options be considered part of the parent for help display #1039
- Add a modifier to allow non-standard single flag option names such as
-option. #1078 - Add modifier for subcommands to disable fallthrough which can resolve some issues with positional arguments #1073
- Add some polish to config file output removing some unnecessary output and add modifier to control output of default values #1075
- Add the ability to specify pair/tuple defaults and improved parsing #1081
- Bugfix: Take the configurability of an option name into account when determining naming conflicts #1049
- Bugfix: Fix an issue where an extra subcommand header was being printed in the output #1058
- Bugfix: Add additional fuzzing tests and fixes for a bug in escape string processing, and resolve inconsistencies in the handing of
{}between command line parsing and config file parsing. #1060 - Bugfix: Improve handling of some ambiguities in vector input processing for config files, specifically in the case of vector of vector inputs. #1069
- Bugfix: Fix an issue in the handling of uint8_t enums, and some issues related to single element tuples #1087
- Bugfix: Fix an issue with binary strings containing a
\x#1097 - Bugfix: Move the help generation priority so it triggers before config file processing #1106
- Bugfix: Fixed an issue where max/min on positionals was not being respected and optional positionals were being ignored #1108
- Bugfix: Fix an issue with strings which started and ended with brackets being misinterpreted as vectors. The parsing now has special handling of strings which start with
[[#1110 - Bugfix: Fix some macros for support in C++26 related to wide string parsing #1113
- Bugfix: Allow trailing spaces on numeric string conversions #1115
- Docs: Update pymod.find_installation to find python in meson.build #1076
- Docs: Add example for transform validators #689
- Docs: Fix several spelling mistakes #1101
- Backend: Update copyright dates to 2025 #1112
- Backend: Update CMake minimum version to 3.10 #1084
New Contributors
- @uilianries made their first contribution in #1061
- @LostInCompilation made their first contribution in #866
- @tansy made their first contribution in #975
- @JonathanGzzBen made their first contribution in #689
- @nshaheed made their first contribution in #1076
- @jmarrec made their first contribution in #1113
Full Changelog: v2.4.2...v2.5.0
Version 2.4.2: Build systems
This version improves support for alternative build systems, like Meson and Bazel. The single-include file now is in its own subdirectory. Several smaller fixes as well.
What's Changed
- Meson: fixes, cleanups, and modernizations #1024 & #1025
- Support building with Bazel #1033
- Restore non-arch dependent path for the pkgconfig file #1012
- Add
get_subcommand_no_throw#1016 - Move single file to
single-includefolder #1030 & #1036 - Fixed
app.set_failure_message(...)->app.failure_message(...)#1018 - Add IWYU pragmas #1008
- Fix internal header include paths #1011
- Improved clarity in
RequiredError#1029 - Added ability to use lexical_cast overloads constrained with enable_if #1021
- Bug fixes in latest release related to environmental variable parsing from option groups and unrecognized fields in a config file #1005
New Contributors
- @krico made their first contribution in #1018
- @dcbaker made their first contribution in #1024
- @gostefan made their first contribution in #1008
- @sifferman made their first contribution in #1029
- @calebzulawski made their first contribution in #1033
Full Changelog: v2.4.1...v2.4.2
Version 2.4.1
A transitive include that might be present in some standard libraries is now included directly. Also fixes a test on architectures that need libatomic linked and fixes an inadvertent breaking change regarding unused defaults for config files.
- Bugfix: Include cstdint #996
- Bugfix: Fix change in operation of config_ptr with unused default in the count method #1003
- Tests: Include libatomic if required for fuzzing test #1000
Full Changelog: v2.4.0...v2.4.1
Version 2.4.0
This version adds Unicode support, support for TOML standard including multiline strings, digit separators, string escape sequences,and dot notation. An initial round of a fuzzer was added to testing which has caught several bugs related to config file processing, and a few other edge cases not previously observed.
- Add Unicode support and bug fixes #804, #923, #876, #848, #832, #987
- Match TOML standard for string and numerical entries, multiline strings #968, #967,#964, #935
- Add validation for environmental variables #926
- Add an escape string transform #970
- Add A REVERSE multi-option policy to support multiple config files and other applications #918
- Add usage message replacement #768
- Allow using dot notation for subcommand arguments such as
--sub1.field#789 - Bugfix: Fuzzing tests and fixes #930, #905, #874, #846
- Bugfix: Missing coverage tests #928
- Bugfix: CMake package and package config tests and fixes #916
- Bugfix: Support for Windows ARM compilation and tests #913, #914
- Bugfix: Environmental variable checks in non-triggered subcommands #904
- Bugfix: Environmental variables were not being correctly process by config pointer #891
- Bugfix: Undefined behavior in
sum_string_vector#893 - Bugfix: Warnings and updates for CUDA 11 support #851
- Backend: Add tests for newer compilers (lost with Travis CI) #972
- Backend: Increase minimum CMake to 3.5 #898
- Backend: Remove integrated Conan support (provided now by Conan center) #853
- Tests: Support Catch2 Version 3 #896, #980
New Contributors
- @andreasxp made their first contribution in #804
- @Krzmbrzl made their first contribution in #844
- @ptheywood made their first contribution in #851
- @trokhymchuk made their first contribution in #893
- @peterh made their first contribution in #913
- @looopTools made their first contribution in #969
Full Changelog: v2.3.2...v2.4.0
Version 2.3.2: Minor maintenance
This version provides a few fixes collected over the last three months before adding features for 2.4.
- Bugfix: Consistently use ADL for
lexical_cast, making it easier to extend for custom template types #820 - Bugfix: Tweak the parsing of files for flags with
disable_flag_override#800] - Bugfix: Handle out of bounds long long #807
- Bugfix: Spacing of
make_descriptionmin option output #808 - Bugfix: Print last parsed subcommand's help message #822
- Bugfix: Avoid floating point warning in GCC 12 #803
- Bugfix: Fix a few gcc warnings #813
- Backend: Max CMake tested 3.22 -> 3.24 #823
New Contributors
- @DarkWingMcQuack made their first contribution in #803
- @SherlockInSpace made their first contribution in #808
- @captainurist made their first contribution in #820
- @VolkerChristian made their first contribution in #822
Full Changelog: v2.3.1...v2.3.2
Version 2.3.1: Missing function implementation
A function implementation was missing after the pre-compile move, missed due to the fact we lost 100% after losing coverage checking. We are working on filling out 100% coverage again to ensure this doesn't happen again!
Version 2.3: Precompilation Support
This version adds a pre-compiled mode to CLI11, which allows you to precompile the library, saving time on incremental rebuilds, making CLI11 more competitive on compile time with classic compiled CLI libraries. The header-only mode is still default, and is not yet distributed via binaries.
- Add
CLI11_PRECOMPILEDas an option. #762 - Bugfix: Include
<functional>inFormatterFwd#727 - Bugfix: Add missing
Macros.hpptoError.hpp#755 - Bugfix: Fix subcommand callback trigger #733
- Bugfix: Variable rename to avoid warning #734
- Bugfix:
split_program_namesingle file name error #740 - Bugfix: Better support for min/max overrides on MSVC #741
- Bugfix: Support MSVC 2022 #748
- Bugfix: Support negated flag in config file #775
- Bugfix: Better errors for some confusing config file situations #781
- Backend: Restore coverage testing (lost with Travis CI) #747
New Contributors
- @shameekganguly made their first contribution in #727
- @PeteAudinate made their first contribution in #734
- @dherrera-fb made their first contribution in #762
Full Changelog: v2.2.0...v2.3.0
Version 2.2: Option and Configuration Flexibility
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 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> or std::optional<int> when used in a flag. The default behavior is now as a single argument value vs. summing all the arguments. The default summing behavior is now restricted to pure integral types, int64_t, int, uint32_t, etc. Use the new sum multi 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 arguments. #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