Skip to content

Commit 88e9bb1

Browse files
phlptphenryiii
andauthored
docs: release update (#974)
Update the Readme and the changelog in preparation for a release. --------- Signed-off-by: Henry Schreiner <[email protected]> Co-authored-by: Henry Schreiner <[email protected]> Co-authored-by: Henry Schreiner <[email protected]>
1 parent b8edd50 commit 88e9bb1

File tree

2 files changed

+94
-55
lines changed

2 files changed

+94
-55
lines changed

CHANGELOG.md

+67-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,79 @@
11
# Changelog
22

3+
## Version 2.4: Unicode and TOML support
4+
5+
This version adds Unicode support, support for TOML standard including multiline
6+
strings, digit separators, string escape sequences,and dot notation. An initial
7+
round of a fuzzer was added to testing which has caught several bugs related to
8+
config file processing, and a few other edge cases not previously observed.
9+
10+
- Add Unicode support and bug fixes [#804][], [#923][], [#876][], [#848][],
11+
[#832][], [#987][]
12+
- Match TOML standard for string and numerical entries, multiline strings
13+
[#968][], [#967][],[#964][], [#935][]
14+
- Add validation for environmental variables [#926][]
15+
- Add an escape string transform [#970][]
16+
- Add A REVERSE multi-option policy to support multiple config files and other
17+
applications [#918][]
18+
- Add usage message replacement [#768][]
19+
- Allow using dot notation for subcommand arguments such as `--sub1.field`
20+
[#789][]
21+
- Bugfix: Fuzzing tests and fixes [#930][], [#905][], [#874][], [#846][]
22+
- Bugfix: Missing coverage tests [#928][]
23+
- Bugfix: CMake package and package config tests and fixes [#916][]
24+
- Bugfix: Support for Windows ARM compilation and tests [#913][], [#914][]
25+
- Bugfix: Environmental variable checks in non-triggered subcommands [#904][]
26+
- Bugfix: Environmental variables were not being correctly process by config
27+
pointer [#891][]
28+
- Bugfix: Undefined behavior in `sum_string_vector` [#893][]
29+
- Bugfix: Warnings and updates for CUDA 11 support [#851][]
30+
- Backend: Add tests for newer compilers (lost with Travis CI) [#972][]
31+
- Backend: Increase minimum CMake to 3.5 [#898][]
32+
- Backend: Remove integrated Conan support (provided now by Conan center)
33+
[#853][]
34+
- Tests: Support Catch2 Version 3 [#896][], [#980][]
35+
36+
[#768]: https://github.com/CLIUtils/CLI11/pull/768
37+
[#789]: https://github.com/CLIUtils/CLI11/pull/789
38+
[#804]: https://github.com/CLIUtils/CLI11/pull/804
39+
[#832]: https://github.com/CLIUtils/CLI11/pull/832
40+
[#846]: https://github.com/CLIUtils/CLI11/pull/846
41+
[#848]: https://github.com/CLIUtils/CLI11/pull/848
42+
[#851]: https://github.com/CLIUtils/CLI11/pull/851
43+
[#853]: https://github.com/CLIUtils/CLI11/pull/853
44+
[#874]: https://github.com/CLIUtils/CLI11/pull/874
45+
[#876]: https://github.com/CLIUtils/CLI11/pull/876
46+
[#891]: https://github.com/CLIUtils/CLI11/pull/891
47+
[#893]: https://github.com/CLIUtils/CLI11/pull/893
48+
[#896]: https://github.com/CLIUtils/CLI11/pull/896
49+
[#898]: https://github.com/CLIUtils/CLI11/pull/898
50+
[#904]: https://github.com/CLIUtils/CLI11/pull/904
51+
[#905]: https://github.com/CLIUtils/CLI11/pull/905
52+
[#913]: https://github.com/CLIUtils/CLI11/pull/913
53+
[#914]: https://github.com/CLIUtils/CLI11/pull/914
54+
[#916]: https://github.com/CLIUtils/CLI11/pull/916
55+
[#918]: https://github.com/CLIUtils/CLI11/pull/918
56+
[#923]: https://github.com/CLIUtils/CLI11/pull/923
57+
[#926]: https://github.com/CLIUtils/CLI11/pull/926
58+
[#928]: https://github.com/CLIUtils/CLI11/pull/928
59+
[#930]: https://github.com/CLIUtils/CLI11/pull/930
60+
[#935]: https://github.com/CLIUtils/CLI11/pull/935
61+
[#964]: https://github.com/CLIUtils/CLI11/pull/964
62+
[#967]: https://github.com/CLIUtils/CLI11/pull/967
63+
[#968]: https://github.com/CLIUtils/CLI11/pull/968
64+
[#970]: https://github.com/CLIUtils/CLI11/pull/970
65+
[#972]: https://github.com/CLIUtils/CLI11/pull/972
66+
[#980]: https://github.com/CLIUtils/CLI11/pull/980
67+
[#987]: https://github.com/CLIUtils/CLI11/pull/987
68+
369
## Version 2.3: Precompilation Support
470

571
This version adds a pre-compiled mode to CLI11, which allows you to precompile
672
the library, saving time on incremental rebuilds, making CLI11 more competitive
773
on compile time with classic compiled CLI libraries. The header-only mode is
874
still default, and is not yet distributed via binaries.
975

10-
- Add `CLI11_PRECOMPILED` as an option. [#762][]
76+
- Add `CLI11_PRECOMPILED` as an option [#762][]
1177
- Bugfix: Include `<functional>` in `FormatterFwd` [#727][]
1278
- Bugfix: Add missing `Macros.hpp` to `Error.hpp` [#755][]
1379
- Bugfix: Fix subcommand callback trigger [#733][]

README.md

+27-54
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ int main(int argc, char** argv) {
206206
}
207207
```
208208
209-
For more information about 🚧`ensure_utf8` the section on
210-
[Unicode support](#unicode-support) below. The 🚧`ensure_utf8` function is only
209+
For more information about 🆕`ensure_utf8` the section on
210+
[Unicode support](#unicode-support) below. The 🆕`ensure_utf8` function is only
211211
available in main currently and not in a release.
212212
213213
<details><summary>Note: If you don't like macros, this is what that macro expands to: (click to expand)</summary><p>
@@ -416,7 +416,7 @@ Before parsing, you can set the following options:
416416
option. Options can be removed from the excludes list with
417417
`->remove_excludes(opt)`
418418
- `->envname(name)`: Gets the value from the environment if present and not
419-
passed on the command line. 🚧 The value must also pass any validators to be
419+
passed on the command line. 🆕 The value must also pass any validators to be
420420
used.
421421
- `->group(name)`: The help group to put the option in. No effect for positional
422422
options. Defaults to `"Options"`. Options given an empty string will not show
@@ -452,7 +452,7 @@ Before parsing, you can set the following options:
452452
are `CLI::MultiOptionPolicy::Throw`, `CLI::MultiOptionPolicy::Throw`,
453453
`CLI::MultiOptionPolicy::TakeLast`, `CLI::MultiOptionPolicy::TakeFirst`,
454454
`CLI::MultiOptionPolicy::Join`, `CLI::MultiOptionPolicy::TakeAll`,
455-
`CLI::MultiOptionPolicy::Sum` 🆕, and `CLI::MultiOptionPolicy::Reverse` 🚧.
455+
`CLI::MultiOptionPolicy::Sum`, and `CLI::MultiOptionPolicy::Reverse` 🆕.
456456
- `->check(std::string(const std::string &), validator_name="",validator_description="")`:
457457
Define a check function. The function should return a non empty string with
458458
the error message if the check fails
@@ -694,15 +694,15 @@ NOTES: If the container used in `IsMember`, `Transformer`, or
694694
fast search is performed first, and if that fails a linear search with the
695695
filters on the key values is performed.
696696
697-
- `CLI::FileOnDefaultPath(default_path)`: 🆕 can be used to check for files in a
697+
- `CLI::FileOnDefaultPath(default_path)`: can be used to check for files in a
698698
default path. If used as a transform it will first check that a file exists,
699699
if it does nothing further is done, if it does not it tries to add a default
700700
Path to the file and search there again. If the file does not exist an error
701701
is returned normally but this can be disabled using
702702
`CLI::FileOnDefaultPath(default_path, false)`. This allows multiple paths to
703703
be chained using multiple transform calls.
704704
705-
- `CLI::EscapedString`: 🚧 can be used to process an escaped string. The
705+
- `CLI::EscapedString`: 🆕 can be used to process an escaped string. The
706706
processing is equivalent to that used for TOML config files, see
707707
[TOML strings](https://toml.io/en/v1.0.0#string). With 2 notable exceptions.
708708
\` can also be used as a literal string notation, and it also allows binary
@@ -874,7 +874,7 @@ nameless subcommands are allowed. Callbacks for nameless subcommands are only
874874
triggered if any options from the subcommand were parsed. Subcommand names given
875875
through the `add_subcommand` method have the same restrictions as option names.
876876

877-
🚧 Options or flags in a subcommand may be directly specified using dot notation
877+
🆕 Options or flags in a subcommand may be directly specified using dot notation
878878

879879
- `--subcommand.long=val` (long subcommand option)
880880
- `--subcommand.long val` (long subcommand option)
@@ -886,7 +886,7 @@ through the `add_subcommand` method have the same restrictions as option names.
886886
The use of dot notation in this form is equivalent `--subcommand.long <args>` =>
887887
`subcommand --long <args> ++`. Nested subcommands also work `sub1.subsub` would
888888
trigger the subsub subcommand in `sub1`. This is equivalent to "sub1 subsub".
889-
Quotes around the subcommand names are permitted 🚧 following the TOML standard
889+
Quotes around the subcommand names are permitted 🆕 following the TOML standard
890890
for such specification. This includes allowing escape sequences. For example
891891
`"subcommand".'f'` or `"subcommand.with.dots".arg1 = value`.
892892

@@ -926,9 +926,9 @@ option_groups. These are:
926926
before matching. Validation is specified through `transform`, `check`, and
927927
`each` for an option. If an argument fails validation it is not an error and
928928
matching proceeds to the next available positional or extra arguments.
929-
- `.validate_optional_arguments()`:🆕 Specify that optional arguments should
930-
pass validation before being assigned to an option. Validation is specified
931-
through `transform`, `check`, and `each` for an option. If an argument fails
929+
- `.validate_optional_arguments()`: Specify that optional arguments should pass
930+
validation before being assigned to an option. Validation is specified through
931+
`transform`, `check`, and `each` for an option. If an argument fails
932932
validation it is not an error and matching proceeds to the next available
933933
positional subcommand or extra arguments.
934934
- `.excludes(option_or_subcommand)`: If given an option pointer or pointer to
@@ -1014,9 +1014,9 @@ option_groups. These are:
10141014
- `.prefix_command()`: Like `allow_extras`, but stop immediately on the first
10151015
unrecognized item. It is ideal for allowing your app or subcommand to be a
10161016
"prefix" to calling another app.
1017-
- `.usage(message)`: 🚧 Replace text to appear at the start of the help string
1017+
- `.usage(message)`: 🆕 Replace text to appear at the start of the help string
10181018
after description.
1019-
- `.usage(std::string())`: 🚧 Set a callback to generate a string that will
1019+
- `.usage(std::string())`: 🆕 Set a callback to generate a string that will
10201020
appear at the start of the help string after description.
10211021
- `.footer(message)`: Set text to appear at the bottom of the help string.
10221022
- `.footer(std::string())`: Set a callback to generate a string that will appear
@@ -1223,8 +1223,8 @@ is present, it will be read along with the normal command line arguments. The
12231223
file will be read if it exists, and does not throw an error unless `required` is
12241224
`true`. Configuration files are in [TOML][] format by default, though the
12251225
default reader can also accept files in INI format as well. The config reader
1226-
can read most aspects of TOML files including strings both literal 🚧 and with
1227-
potential escape sequences 🚧, digit separators 🚧, and multi-line strings 🚧,
1226+
can read most aspects of TOML files including strings both literal 🆕 and with
1227+
potential escape sequences 🆕, digit separators 🆕, and multi-line strings 🆕,
12281228
and run them through the CLI11 parser. Other formats can be added by an adept
12291229
user, some variations are available through customization points in the default
12301230
formatter. An example of a TOML file:
@@ -1297,9 +1297,9 @@ boolean values are not quoted.
12971297
12981298
For options or flags which allow 0 arguments to be passed using an empty string
12991299
in the config file, `{}`, or `[]` will convert the result to the default value
1300-
specified via `default_str` or `default_val` on the option 🆕. If no user
1301-
specified default is given the result is an empty string or the converted value
1302-
of an empty string.
1300+
specified via `default_str` or `default_val` on the option. If no user specified
1301+
default is given the result is an empty string or the converted value of an
1302+
empty string.
13031303
13041304
NOTE: Transforms and checks can be used with the option pointer returned from
13051305
set_config like any other option to validate the input if needed. It can also be
@@ -1427,8 +1427,8 @@ CLI11 supports Unicode and wide strings as defined in the
14271427
14281428
When using the command line on Windows with unicode arguments, your `main`
14291429
function may already receive broken Unicode. Parsing `argv` at that point will
1430-
not give you a correct string. To fix this, you have three good options and two
1431-
bad ones:
1430+
not give you a correct string. To fix this, you have three options; the first is
1431+
recommended for cross-platform support:
14321432
14331433
1\. Replace `argv` with `app.ensure_utf8(argv)` before any arguments are parsed.
14341434
`ensure_utf8` will do nothing on systems where `argv` is already in UTF-8 (Such
@@ -1445,40 +1445,13 @@ int main(int argc, char** argv) {
14451445
}
14461446
```
14471447

1448-
2\. If you pass unmodified command-line arguments to CLI11, call `app.parse()`
1449-
instead of `app.parse(argc, argv)` (or `CLI11_PARSE(app)` instead of
1450-
`CLI11_PARSE(app, argc, argv)`). The library will find correct arguments by
1451-
itself.
1448+
Be sure you do not modify `argv` before this function call, as the correct
1449+
values will be reconstructed using Windows APIs and produced by this call. It
1450+
has no effect on other platforms and just passes through `argv`.
14521451

1453-
> [!NOTE]
1454-
>
1455-
> This approach may not work on weird OS configurations, such as when the
1456-
> `/proc` dir is missing on Linux systems (see also
1457-
> [#845](https://github.com/CLIUtils/CLI11/issues/845)).
1458-
>
1459-
> ```cpp
1460-
> int main() {
1461-
> CLI::App app;
1462-
> // ...
1463-
> CLI11_PARSE(app);
1464-
> }
1465-
> ```
1466-
1467-
3\. Get correct arguments with which the program was originally executed using
1468-
provided functions: `CLI::argc()` and `CLI::argv()`. These three methods are the
1469-
only cross-platform ways of handling unicode correctly.
1470-
1471-
```cpp
1472-
int main() {
1473-
CLI::App app;
1474-
// ...
1475-
CLI11_PARSE(app, CLI::argc(), CLI::argv());
1476-
}
1477-
```
1478-
1479-
<details><summary>Bad options (click to expand)</summary><p>
1452+
<details><summary>Other options (click to expand)</summary><p>
14801453

1481-
4\. Use the Windows-only non-standard `wmain` function, which accepts
1454+
2\. Use the Windows-only non-standard `wmain` function, which accepts
14821455
`wchar_t *argv[]` instead of `char* argv[]`. Parsing this will allow CLI to
14831456
convert wide strings to UTF-8 without losing information.
14841457

@@ -1490,10 +1463,10 @@ int wmain(int argc, wchar_t *argv[]) {
14901463
}
14911464
```
14921465
1493-
5\. Retrieve arguments yourself by using Windows APIs like
1466+
3\. Retrieve arguments yourself by using Windows APIs like
14941467
[`CommandLineToArgvW`](https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-commandlinetoargvw)
14951468
and pass them to CLI. This is what the library is doing under the hood in
1496-
`CLI::argv()`.
1469+
`ensure_utf8`.
14971470
14981471
</p></details>
14991472
</br>

0 commit comments

Comments
 (0)