Skip to content

Commit 4160d25

Browse files
phlptppre-commit-ci[bot]henryiii
authored
update version and changelog for 2.5 release (#1121)
update readme, changelog, and version for 2.5 release --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <[email protected]>
1 parent a48f049 commit 4160d25

File tree

3 files changed

+100
-29
lines changed

3 files changed

+100
-29
lines changed

CHANGELOG.md

+69-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,75 @@
22

33
## Unreleased
44

5-
- add mechanism to allow option groups to be hidden and all options be
6-
considered part of the parent for help display
5+
## Version 2.5: Help Formatter
6+
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
10+
and config file parsing.
11+
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
15+
considered part of the parent for help display [#1039][]
16+
- Add a modifier to allow non-standard single flag option names such as
17+
`-option`. [#1078][]
18+
- Add modifier for subcommands to disable fallthrough which can resolve some
19+
issues with positional arguments [#1073][]
20+
- Add some polish to config file output removing some unnecessary output and add
21+
modifier to control output of default values [#1075][]
22+
- Add the ability to specify pair/tuple defaults and improved parsing [#1081][]
23+
- Bugfix: Take the configurability of an option name into account when
24+
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
36+
processing [#1106][]
37+
- Bugfix: Fixed an issue where max/min on positionals was not being respected
38+
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
41+
which start with `[[` [#1110][]
42+
- Bugfix: Fix some macros for support in C++26 related to wide string parsing
43+
[#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][]
50+
51+
[#1039]: https://github.com/CLIUtils/CLI11/pull/1039
52+
[#1049]: https://github.com/CLIUtils/CLI11/pull/1049
53+
[#1058]: https://github.com/CLIUtils/CLI11/pull/1058
54+
[#1060]: https://github.com/CLIUtils/CLI11/pull/1060
55+
[#1069]: https://github.com/CLIUtils/CLI11/pull/1069
56+
[#866]: https://github.com/CLIUtils/CLI11/pull/866
57+
[#1073]: https://github.com/CLIUtils/CLI11/pull/1073
58+
[#1075]: https://github.com/CLIUtils/CLI11/pull/1075
59+
[#689]: https://github.com/CLIUtils/CLI11/pull/689
60+
[#1076]: https://github.com/CLIUtils/CLI11/pull/1076
61+
[#1078]: https://github.com/CLIUtils/CLI11/pull/1078
62+
[#1081]: https://github.com/CLIUtils/CLI11/pull/1081
63+
[#1084]: https://github.com/CLIUtils/CLI11/pull/1084
64+
[#1087]: https://github.com/CLIUtils/CLI11/pull/1087
65+
[#1093]: https://github.com/CLIUtils/CLI11/pull/1093
66+
[#1097]: https://github.com/CLIUtils/CLI11/pull/1097
67+
[#1101]: https://github.com/CLIUtils/CLI11/pull/1101
68+
[#1106]: https://github.com/CLIUtils/CLI11/pull/1106
69+
[#1108]: https://github.com/CLIUtils/CLI11/pull/1108
70+
[#1110]: https://github.com/CLIUtils/CLI11/pull/1110
71+
[#1112]: https://github.com/CLIUtils/CLI11/pull/1112
72+
[#1113]: https://github.com/CLIUtils/CLI11/pull/1113
73+
[#1115]: https://github.com/CLIUtils/CLI11/pull/1115
774

875
## Version 2.4: Unicode and TOML support
976

README.md

+28-24
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ this library:
165165
option to disable it).
166166
- Autocomplete: This might eventually be added to both Plumbum and CLI11, but it
167167
is not supported yet.
168+
- While not recommended, CLI11 does now support non standard option names such
169+
as `-option`. 🆕. This is enabled through `allow_non_standard_option_names()`
170+
modifier on an app.
168171

169172
## Install
170173

@@ -203,9 +206,8 @@ int main(int argc, char** argv) {
203206
}
204207
```
205208
206-
For more information about 🆕`ensure_utf8` the section on
207-
[Unicode support](#unicode-support) below. The 🆕`ensure_utf8` function is only
208-
available in main currently and not in a release.
209+
For more information about `ensure_utf8` the section on
210+
[Unicode support](#unicode-support) below.
209211
210212
<details><summary>Note: If you don't like macros, this is what that macro expands to: (click to expand)</summary><p>
211213
@@ -415,7 +417,7 @@ Before parsing, you can set the following options:
415417
option. Options can be removed from the excludes list with
416418
`->remove_excludes(opt)`
417419
- `->envname(name)`: Gets the value from the environment if present and not
418-
passed on the command line. 🆕 The value must also pass any validators to be
420+
passed on the command line. The value must also pass any validators to be
419421
used.
420422
- `->group(name)`: The help group to put the option in. No effect for positional
421423
options. Defaults to `"Options"`. Options given an empty string will not show
@@ -451,7 +453,7 @@ Before parsing, you can set the following options:
451453
are `CLI::MultiOptionPolicy::Throw`, `CLI::MultiOptionPolicy::Throw`,
452454
`CLI::MultiOptionPolicy::TakeLast`, `CLI::MultiOptionPolicy::TakeFirst`,
453455
`CLI::MultiOptionPolicy::Join`, `CLI::MultiOptionPolicy::TakeAll`,
454-
`CLI::MultiOptionPolicy::Sum`, and `CLI::MultiOptionPolicy::Reverse` 🆕.
456+
`CLI::MultiOptionPolicy::Sum`, and `CLI::MultiOptionPolicy::Reverse`.
455457
- `->check(std::string(const std::string &), validator_name="",validator_description="")`:
456458
Define a check function. The function should return a non empty string with
457459
the error message if the check fails
@@ -701,8 +703,8 @@ filters on the key values is performed.
701703
`CLI::FileOnDefaultPath(default_path, false)`. This allows multiple paths to
702704
be chained using multiple transform calls.
703705
704-
- `CLI::EscapedString`: 🆕 can be used to process an escaped string. The
705-
processing is equivalent to that used for TOML config files, see
706+
- `CLI::EscapedString`: can be used to process an escaped string. The processing
707+
is equivalent to that used for TOML config files, see
706708
[TOML strings](https://toml.io/en/v1.0.0#string). With 2 notable exceptions.
707709
\` can also be used as a literal string notation, and it also allows binary
708710
string notation see
@@ -859,7 +861,9 @@ triggered once unless the `.immediate_callback()` flag is set or the callback is
859861
specified through the `parse_complete_callback()` function. The
860862
`final_callback()` is triggered only once. In which case the callback executes
861863
on completion of the subcommand arguments but after the arguments for that
862-
subcommand have been parsed, and can be triggered multiple times.
864+
subcommand have been parsed, and can be triggered multiple times. Note that the
865+
`parse_complete_callback()` is executed prior to processing any config files.
866+
The `final_callback()` is executed after config file processing.
863867

864868
Subcommands may also have an empty name either by calling `add_subcommand` with
865869
an empty string for the name or with no arguments. Nameless subcommands function
@@ -873,7 +877,7 @@ nameless subcommands are allowed. Callbacks for nameless subcommands are only
873877
triggered if any options from the subcommand were parsed. Subcommand names given
874878
through the `add_subcommand` method have the same restrictions as option names.
875879

876-
🆕 Options or flags in a subcommand may be directly specified using dot notation
880+
Options or flags in a subcommand may be directly specified using dot notation
877881

878882
- `--subcommand.long=val` (long subcommand option)
879883
- `--subcommand.long val` (long subcommand option)
@@ -885,8 +889,8 @@ through the `add_subcommand` method have the same restrictions as option names.
885889
The use of dot notation in this form is equivalent `--subcommand.long <args>` =>
886890
`subcommand --long <args> ++`. Nested subcommands also work `sub1.subsub` would
887891
trigger the subsub subcommand in `sub1`. This is equivalent to "sub1 subsub".
888-
Quotes around the subcommand names are permitted 🆕 following the TOML standard
889-
for such specification. This includes allowing escape sequences. For example
892+
Quotes around the subcommand names are permitted following the TOML standard for
893+
such specification. This includes allowing escape sequences. For example
890894
`"subcommand".'f'` or `"subcommand.with.dots".arg1 = value`.
891895

892896
#### Subcommand options
@@ -902,7 +906,7 @@ option_groups. These are:
902906
the form of `/s /long /file:file_name.ext` This option does not change how
903907
options are specified in the `add_option` calls or the ability to process
904908
options in the form of `-s --long --file=file_name.ext`.
905-
- `.allow_non_standard_option_names()`:🚧 Allow specification of single `-` long
909+
- `.allow_non_standard_option_names()`:🆕 Allow specification of single `-` long
906910
form option names. This is not recommended but is available to enable
907911
reworking of existing interfaces. If this modifier is enabled on an app or
908912
subcommand, options or flags can be specified like normal but instead of
@@ -914,8 +918,8 @@ option_groups. These are:
914918
through" and be matched on a parent option. Subcommands by default are allowed
915919
to "fall through" as in they will first attempt to match on the current
916920
subcommand and if they fail will progressively check parents for matching
917-
subcommands. This can be disabled through `subcommand_fallthrough(false)` 🚧.
918-
- `.subcommand_fallthrough()`: 🚧 Allow subcommands to "fall through" and be
921+
subcommands. This can be disabled through `subcommand_fallthrough(false)` 🆕.
922+
- `.subcommand_fallthrough()`: 🆕 Allow subcommands to "fall through" and be
919923
matched on a parent option. Disabling this prevents additional subcommands at
920924
the same level from being matched. It can be useful in certain circumstances
921925
where there might be ambiguity between subcommands and positionals. The
@@ -1027,10 +1031,10 @@ option_groups. These are:
10271031
the first unrecognized item. All subsequent arguments are placed in the
10281032
remaining_arg list. It is ideal for allowing your app or subcommand to be a
10291033
"prefix" to calling another app.
1030-
- `.usage(message)`: 🆕 Replace text to appear at the start of the help string
1034+
- `.usage(message)`: Replace text to appear at the start of the help string
10311035
after description.
1032-
- `.usage(std::string())`: 🆕 Set a callback to generate a string that will
1033-
appear at the start of the help string after description.
1036+
- `.usage(std::string())`: Set a callback to generate a string that will appear
1037+
at the start of the help string after description.
10341038
- `.footer(message)`: Set text to appear at the bottom of the help string.
10351039
- `.footer(std::string())`: Set a callback to generate a string that will appear
10361040
at the end of the help string.
@@ -1113,8 +1117,8 @@ A subcommand is considered terminated when one of the following conditions are
11131117
met.
11141118

11151119
1. There are no more arguments to process
1116-
2. Another subcommand is encountered that would not fit in an optional slot of
1117-
the subcommand
1120+
2. Another subcommand is encountered that would not fit in an optional
1121+
positional slot of the subcommand
11181122
3. The `positional_mark` (`--`) is encountered and there are no available
11191123
positional slots in the subcommand.
11201124
4. The `subcommand_terminator` mark (`++`) is encountered
@@ -1246,11 +1250,11 @@ is present, it will be read along with the normal command line arguments. The
12461250
file will be read if it exists, and does not throw an error unless `required` is
12471251
`true`. Configuration files are in [TOML][] format by default, though the
12481252
default reader can also accept files in INI format as well. The config reader
1249-
can read most aspects of TOML files including strings both literal 🆕 and with
1250-
potential escape sequences 🆕, digit separators 🆕, and multi-line strings 🆕,
1251-
and run them through the CLI11 parser. Other formats can be added by an adept
1252-
user, some variations are available through customization points in the default
1253-
formatter. An example of a TOML file:
1253+
can read most aspects of TOML files including strings both literal and with
1254+
potential escape sequences, digit separators, and multi-line strings, and run
1255+
them through the CLI11 parser. Other formats can be added by an adept user, some
1256+
variations are available through customization points in the default formatter.
1257+
An example of a TOML file:
12541258

12551259
```toml
12561260
# Comments are supported, using a #

include/CLI/Version.hpp

+3-3
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 4
15-
#define CLI11_VERSION_PATCH 2
16-
#define CLI11_VERSION "2.4.2"
14+
#define CLI11_VERSION_MINOR 5
15+
#define CLI11_VERSION_PATCH 0
16+
#define CLI11_VERSION "2.5.0"
1717

1818
// [CLI11:version_hpp:end]

0 commit comments

Comments
 (0)