Skip to content

Commit 3914826

Browse files
Version update (#1219)
update changelog for 2.6 release --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 8225a6a commit 3914826

File tree

7 files changed

+176
-53
lines changed

7 files changed

+176
-53
lines changed

.github/workflows/codeql.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ jobs:
4949
build-mode: autobuild
5050
- language: python
5151
build-mode: none
52-
- language: ruby
53-
build-mode: none
5452
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
5553
# Use `c-cpp` to analyze code written in C, C++ or both
5654
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both

.github/workflows/tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ jobs:
127127
run: cmake --build build -j2
128128

129129
cuda12-build:
130-
name: CUDA 12 build only
130+
name: CUDA 13 build only
131131
runs-on: ubuntu-latest
132-
container: nvidia/cuda:12.3.1-devel-ubuntu22.04
132+
container: nvidia/cuda:13.0.0-devel-ubuntu22.04
133133
steps:
134134
- name: Add build tools
135135
run: apt-get update && apt-get install -y wget git cmake
@@ -387,3 +387,9 @@ jobs:
387387
cmake-version: "4.0"
388388
args: -DCLI11_BUILD_EXAMPLES_JSON=ON
389389
if: success() || failure()
390+
391+
- name: Check CMake 4.1
392+
uses: ./.github/actions/quick_cmake
393+
with:
394+
cmake-version: "4.1"
395+
if: success() || failure()

CHANGELOG.md

Lines changed: 148 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,164 @@
22

33
## Unreleased
44

5+
## Version 2.6.0
6+
7+
This version adds finer grained control of when option callbacks are executed,
8+
and further refinements in the help formatting. It also fixes a number of bugs
9+
in type support and the ordering of options. The other major change is moving
10+
Extra Validators to a new file which can be disabled for slightly faster
11+
compilation if not used, and allowing additional future Validators to be easily
12+
added.
13+
14+
### Added
15+
16+
- Added option to align long options with a ratio via
17+
`long_option_alignment_ratio` in the formatter. This allows more control over
18+
help output formatting. [#1185][]
19+
- Added support for `std::string_view` in the `as<T>` method on options.
20+
[#1187][]
21+
- Added flags on the formatter to disable formatting for the description and
22+
footer, allowing custom formatting such as word art. [#1150][]
23+
- Added subcommand prefix matching as a modifier to `CLI::App`. Also included an
24+
example of close matching logic. [#1152][]
25+
- Added additional fuzzing mechanics, including fuzzing subcommands, and
26+
improved handling of edge cases. [#1170][]
27+
- Added new tests for array options and fixed ambiguity between tuple and
28+
container conversions. [#1136][]
29+
- Added ability to use rvalue references in `add_flag` descriptions. [#1173][]
30+
- Added CMake presets for default and tidy builds. [#1181][]
31+
- Added several validator examples and documentation [#1192][]
32+
- Added permission validators for files and directories [#1203][]
33+
- Added fine grained control for option callback priority, and in what order
34+
options including help execute in the processing sequence. [#1226][]
35+
- Added github action to link with future testing is oss-fuzz [#1225][]
36+
37+
### Changed
38+
39+
- Moved several of the validators to `ExtraValidators.hpp` and
40+
`ExtraValidators_inl.hpp` files, The compilation of these nonessential
41+
validators can be disabled by setting `CLI11_DISABLE_EXTRA_VALIDATORS` to
42+
`OFF`. Future additional validators will be behind a compile flag
43+
`CLI11_ENABLE_EXTRA_VALIDATORS`. All non-essential validators will be under
44+
this option with version 3.0. [#1192][]
45+
- Updated processing order: requirements are now checked before callbacks,
46+
avoiding unexpected side effects. [#1186][]
47+
- Updated minimum required CMake version to 3.14+. [#1182][]
48+
- Improved Meson build: support for building shared precompiled libraries,
49+
pkgconfig, and header installation. [#1167][]
50+
- Improved fuzzing tests with new failure cases and extended coverage. [#1164][]
51+
- Updated CI to remove deprecated images and add new ones (Windows-2022/2025,
52+
arm64, FreeBSD). [#1172][], [#1178][]
53+
- Updated license file to include the correct version number for packagers.
54+
[#1180][]
55+
56+
### Fixed
57+
58+
- Fixed issue with IPV4 validator where it would allow a trailing `.`. [#1192][]
59+
- Fixed edge case where a missing config file and no default caused a segfault.
60+
[#1199][]
61+
- Fixed issue with TOML multiline arrays when the first line contained only a
62+
single character. [#1196][]
63+
- Fixed default value conversion errors when locales added thousands separators.
64+
[#1160][]
65+
- Fixed multiple footer printing in help output for option groups. [#1161][]
66+
- Fixed incorrect argument order in extras error messages. [#1162][]
67+
- Fixed reversed argument order in unexpected argument error messages. [#1158][]
68+
- Fixed ambiguity with `vector<array>` options. [#1147][]
69+
- Fixed bug parsing negative floating point values without a leading zero.
70+
[#1140][]
71+
- Fixed spelling mistake in `Error.hpp`. [#1129][]
72+
- Fixed compilation issue with MSVC 2017. [#1143][]
73+
- Fixed issue with default strings of arrays in config output. [#1155][]
74+
- Fixed fuzzing issues with NaNs and certain error pathways. [#1138][]
75+
- Fixed fuzzer misinterpreting `--sub1.-` as a short option. [#1148][]
76+
- Fixed issue where parse_order was not cleared on reset. [#1218][]
77+
- modify code to make compatible with /GR- option in MSVC [#1206][]
78+
- Fixed issue where the version flag would not take precedence over option
79+
requirements [#1226][]
80+
- Fixed extra newlines being printed if a footer was in use [#1229][]
81+
82+
[#1129]: https://github.com/CLIUtils/CLI11/pull/1129
83+
[#1136]: https://github.com/CLIUtils/CLI11/pull/1136
84+
[#1138]: https://github.com/CLIUtils/CLI11/pull/1138
85+
[#1140]: https://github.com/CLIUtils/CLI11/pull/1140
86+
[#1143]: https://github.com/CLIUtils/CLI11/pull/1143
87+
[#1147]: https://github.com/CLIUtils/CLI11/pull/1147
88+
[#1148]: https://github.com/CLIUtils/CLI11/pull/1148
89+
[#1150]: https://github.com/CLIUtils/CLI11/pull/1150
90+
[#1152]: https://github.com/CLIUtils/CLI11/pull/1152
91+
[#1155]: https://github.com/CLIUtils/CLI11/pull/1155
92+
[#1158]: https://github.com/CLIUtils/CLI11/pull/1158
93+
[#1160]: https://github.com/CLIUtils/CLI11/pull/1160
94+
[#1161]: https://github.com/CLIUtils/CLI11/pull/1161
95+
[#1162]: https://github.com/CLIUtils/CLI11/pull/1162
96+
[#1164]: https://github.com/CLIUtils/CLI11/pull/1164
97+
[#1167]: https://github.com/CLIUtils/CLI11/pull/1167
98+
[#1170]: https://github.com/CLIUtils/CLI11/pull/1170
99+
[#1172]: https://github.com/CLIUtils/CLI11/pull/1172
100+
[#1173]: https://github.com/CLIUtils/CLI11/pull/1173
101+
[#1178]: https://github.com/CLIUtils/CLI11/pull/1178
102+
[#1180]: https://github.com/CLIUtils/CLI11/pull/1180
103+
[#1181]: https://github.com/CLIUtils/CLI11/pull/1181
104+
[#1182]: https://github.com/CLIUtils/CLI11/pull/1182
105+
[#1185]: https://github.com/CLIUtils/CLI11/pull/1185
106+
[#1186]: https://github.com/CLIUtils/CLI11/pull/1186
107+
[#1187]: https://github.com/CLIUtils/CLI11/pull/1187
108+
[#1192]: https://github.com/CLIUtils/CLI11/pull/1192
109+
[#1196]: https://github.com/CLIUtils/CLI11/pull/1196
110+
[#1199]: https://github.com/CLIUtils/CLI11/pull/1199
111+
[#1203]: https://github.com/CLIUtils/CLI11/pull/1203
112+
[#1206]: https://github.com/CLIUtils/CLI11/pull/1206
113+
[#1218]: https://github.com/CLIUtils/CLI11/pull/1218
114+
[#1225]: https://github.com/CLIUtils/CLI11/pull/1225
115+
[#1226]: https://github.com/CLIUtils/CLI11/pull/1226
116+
[#1229]: https://github.com/CLIUtils/CLI11/pull/1229
117+
5118
## Version 2.5: Help Formatter
6119

7-
This version add a new formatter with improved control capabilities and output
8-
aligned with standards for help output. It also add a modifier to enable use of
9-
non-standard option names. Along with several bug fixes for edge cases in string
120+
This version adds a new formatter with improved control capabilities and output
121+
aligned with standards for help output. It also adds a modifier to enable use of
122+
non-standard option names, along with several bug fixes for edge cases in string
10123
and config file parsing.
11124

12-
- Better help formatter [#866][], this better aligns the help generation with
13-
UNIX standard and allows use in help2man. [#1093][]
14-
- Add mechanism to allow option groups to be hidden and all options be
125+
- Improved help formatter [#866][], better aligns help generation with UNIX
126+
standards and allows use in help2man. [#1093][]
127+
- Added mechanism to allow option groups to be hidden and all options to be
15128
considered part of the parent for help display [#1039][]
16-
- Add a modifier to allow non-standard single flag option names such as
129+
- Added a modifier to allow non-standard single flag option names such as
17130
`-option`. [#1078][]
18-
- Add modifier for subcommands to disable fallthrough which can resolve some
131+
- Added modifier for subcommands to disable fallthrough, which can resolve some
19132
issues with positional arguments [#1073][]
20-
- Add some polish to config file output removing some unnecessary output and add
133+
- Added polish to config file output, removing unnecessary output and adding
21134
modifier to control output of default values [#1075][]
22-
- Add the ability to specify pair/tuple defaults and improved parsing [#1081][]
135+
- Added ability to specify pair/tuple defaults and improved parsing [#1081][]
23136
- Bugfix: Take the configurability of an option name into account when
24137
determining naming conflicts [#1049][]
25-
- Bugfix: Fix an issue where an extra subcommand header was being printed in the
26-
output [#1058][]
27-
- Bugfix: Add additional fuzzing tests and fixes for a bug in escape string
28-
processing, and resolve inconsistencies in the handing of `{}` between command
29-
line parsing and config file parsing. [#1060][]
30-
- Bugfix: Improve handling of some ambiguities in vector input processing for
31-
config files, specifically in the case of vector of vector inputs. [#1069][]
32-
- Bugfix: Fix an issue in the handling of uint8_t enums, and some issues related
33-
to single element tuples [#1087][]
34-
- Bugfix: Fix an issue with binary strings containing a `\x` [#1097][]
35-
- Bugfix: Move the help generation priority so it triggers before config file
138+
- Bugfix: Fixed an issue where an extra subcommand header was being printed in
139+
the output [#1058][]
140+
- Bugfix: Added additional fuzzing tests and fixes for a bug in escape string
141+
processing, and resolved inconsistencies in the handling of `{}` between
142+
command line parsing and config file parsing. [#1060][]
143+
- Bugfix: Improved handling of ambiguities in vector input processing for config
144+
files, specifically in the case of vector of vector inputs. [#1069][]
145+
- Bugfix: Fixed an issue in the handling of uint8_t enums, and issues related to
146+
single element tuples [#1087][]
147+
- Bugfix: Fixed an issue with binary strings containing a `\x` [#1097][]
148+
- Bugfix: Moved the help generation priority so it triggers before config file
36149
processing [#1106][]
37150
- Bugfix: Fixed an issue where max/min on positionals was not being respected
38151
and optional positionals were being ignored [#1108][]
39-
- Bugfix: Fix an issue with strings which started and ended with brackets being
40-
misinterpreted as vectors. The parsing now has special handling of strings
152+
- Bugfix: Fixed an issue with strings which started and ended with brackets
153+
being misinterpreted as vectors. Parsing now has special handling of strings
41154
which start with `[[` [#1110][]
42-
- Bugfix: Fix some macros for support in C++26 related to wide string parsing
155+
- Bugfix: Fixed some macros for support in C++26 related to wide string parsing
43156
[#1113][]
44-
- Bugfix: Allow trailing spaces on numeric string conversions [#1115][]
45-
- Docs: Update pymod.find_installation to find python in meson.build [#1076][]
46-
- Docs: Add example for transform validators [#689][]
47-
- Docs: Fix several spelling mistakes [#1101][]
48-
- Backend: Update copyright dates to 2025 [#1112][]
49-
- Backend: Update CMAKE minimum version to 3.10 [#1084][]
157+
- Bugfix: Allowed trailing spaces on numeric string conversions [#1115][]
158+
- Docs: Updated pymod.find_installation to find Python in meson.build [#1076][]
159+
- Docs: Added example for transform validators [#689][]
160+
- Docs: Fixed several spelling mistakes [#1101][]
161+
- Backend: Updated copyright dates to 2025 [#1112][]
162+
- Backend: Updated CMAKE minimum version to 3.10 [#1084][]
50163

51164
[#1039]: https://github.com/CLIUtils/CLI11/pull/1039
52165
[#1049]: https://github.com/CLIUtils/CLI11/pull/1049
@@ -79,6 +192,11 @@ strings, digit separators, string escape sequences,and dot notation. An initial
79192
round of a fuzzer was added to testing which has caught several bugs related to
80193
config file processing, and a few other edge cases not previously observed.
81194

195+
NOTE: The fuzzer fixes have had some previously unrecognized changes to allowed
196+
positional names. Positional names with spaces are no longer allowed. This was
197+
not explicitly allowed but not disallowed either, and now it is no longer
198+
allowed as these options may be called in config file parsing.
199+
82200
- Add Unicode support and bug fixes [#804][], [#923][], [#876][], [#848][],
83201
[#832][], [#987][]
84202
- Match TOML standard for string and numerical entries, multiline strings

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CLI11 2.5 Copyright (c) 2017-2025 University of Cincinnati, developed by Henry
1+
CLI11 2.6 Copyright (c) 2017-2025 University of Cincinnati, developed by Henry
22
Schreiner under NSF AWARD 1414736. All rights reserved.
33

44
Redistribution and use in source and binary forms of CLI11, with or without

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ set with a simple and intuitive interface.
4040
- [Default Validators](#default-validators)
4141
- [Validators that may be disabled 🚧](#validators-that-may-be-disabled-)
4242
- [Extra Validators 🚧](#extra-validators-)
43-
- [permission. Requires C++17.](#permission-requires-c17)
44-
- [Validator Usage](#validator-usage)
45-
- [Transforming Validators](#transforming-validators)
46-
- [Validator operations](#validator-operations)
47-
- [Custom Validators](#custom-validators)
48-
- [Querying Validators](#querying-validators)
49-
- [Getting results](#getting-results)
43+
- [Validator Usage](#validator-usage)
44+
- [Transforming Validators](#transforming-validators)
45+
- [Validator operations](#validator-operations)
46+
- [Custom Validators](#custom-validators)
47+
- [Querying Validators](#querying-validators)
48+
- [Getting results](#getting-results)
5049
- [Subcommands](#subcommands)
5150
- [Subcommand options](#subcommand-options)
5251
- [Callbacks](#callbacks)
@@ -167,11 +166,14 @@ this library:
167166
incomplete arguments. It's better not to guess. Most third party command line
168167
parsers for python actually reimplement command line parsing rather than using
169168
argparse because of this perceived design flaw (recent versions do have an
170-
option to disable it).
169+
option to disable it). 🆕 The latest version of CLI11 does include partial
170+
option matching for option prefixes. This is enabled by
171+
`.allow_subcommand_prefix_matching()`, along with an example that generates
172+
suggested close matches.
171173
- Autocomplete: This might eventually be added to both Plumbum and CLI11, but it
172174
is not supported yet.
173175
- While not recommended, CLI11 does now support non standard option names such
174-
as `-option`. 🆕. This is enabled through `allow_non_standard_option_names()`
176+
as `-option`. This is enabled through `allow_non_standard_option_names()`
175177
modifier on an app.
176178

177179
## Install
@@ -503,7 +505,7 @@ Before parsing, you can set the following options:
503505
validation checks for the option to be executed when the option value is
504506
parsed vs. at the end of all parsing. This could cause the callback to be
505507
executed multiple times. Also works with positional options.
506-
- `->callback_priority(CallbackPriority priority)`: 🚧 changes the order in
508+
- `->callback_priority(CallbackPriority priority)`: 🆕 changes the order in
507509
which the option callback is executed. Four principal callback call-points are
508510
available. `CallbackPriority::First` executes at the very beginning of
509511
processing, before configuration files are read and environment variables are
@@ -669,7 +671,6 @@ setting `CLI11_ENABLE_EXTRA_VALIDATORS` to 1
669671
write permission. Requires C++17.
670672
- `CLI::ExecPermission`: Requires that the file given exist and have execution
671673
permission. Requires C++17.
672-
-
673674
674675
#### Validator Usage
675676
@@ -988,15 +989,15 @@ option_groups. These are:
988989
the form of `/s /long /file:file_name.ext` This option does not change how
989990
options are specified in the `add_option` calls or the ability to process
990991
options in the form of `-s --long --file=file_name.ext`.
991-
- `.allow_non_standard_option_names()`:🆕 Allow specification of single `-` long
992+
- `.allow_non_standard_option_names()`: Allow specification of single `-` long
992993
form option names. This is not recommended but is available to enable
993994
reworking of existing interfaces. If this modifier is enabled on an app or
994995
subcommand, options or flags can be specified like normal but instead of
995996
throwing an exception, long form single dash option names will be allowed. It
996997
is not allowed to have a single character short option starting with the same
997998
character as a single dash long form name; for example, `-s` and `-single` are
998999
not allowed in the same application.
999-
- `.allow_subcommand_prefix_matching()`:🚧 If this modifier is enabled,
1000+
- `.allow_subcommand_prefix_matching()`:🆕 If this modifier is enabled,
10001001
unambiguious prefix portions of a subcommand will match. For example
10011002
`upgrade_package` would match on `upgrade_`, `upg`, `u` as long as no other
10021003
subcommand would also match. It also disallows subcommand names that are full
@@ -1005,8 +1006,8 @@ option_groups. These are:
10051006
through" and be matched on a parent option. Subcommands by default are allowed
10061007
to "fall through" as in they will first attempt to match on the current
10071008
subcommand and if they fail will progressively check parents for matching
1008-
subcommands. This can be disabled through `subcommand_fallthrough(false)` 🆕.
1009-
- `.subcommand_fallthrough()`: 🆕 Allow subcommands to "fall through" and be
1009+
subcommands. This can be disabled through `subcommand_fallthrough(false)`.
1010+
- `.subcommand_fallthrough()`: Allow subcommands to "fall through" and be
10101011
matched on a parent option. Disabling this prevents additional subcommands at
10111012
the same level from being matched. It can be useful in certain circumstances
10121013
where there might be ambiguity between subcommands and positionals. The

include/CLI/Version.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
// [CLI11:version_hpp:verbatim]
1212

1313
#define CLI11_VERSION_MAJOR 2
14-
#define CLI11_VERSION_MINOR 5
14+
#define CLI11_VERSION_MINOR 6
1515
#define CLI11_VERSION_PATCH 0
16-
#define CLI11_VERSION "2.5.0"
16+
#define CLI11_VERSION "2.6.0"
1717

1818
// [CLI11:version_hpp:end]

include/CLI/impl/Formatter_inl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ CLI11_INLINE std::string Formatter::make_help(const App *app, std::string name,
177177
if(is_footer_paragraph_formatting_enabled()) {
178178
detail::streamOutAsParagraph(out, footer_string, footer_paragraph_width_); // Format footer as paragraph
179179
} else {
180-
out << footer_string << '\n';
180+
out << footer_string;
181181
}
182182

183183
return out.str();

0 commit comments

Comments
 (0)