@@ -38,8 +38,8 @@ set with a simple and intuitive interface.
3838 - [ Option options] ( #option-options )
3939 - [ Validators] ( #validators )
4040 - [ Default Validators] ( #default-validators )
41- - [ Validators that may be disabled 🚧 ] ( #validators-that-may-be-disabled- )
42- - [ Extra Validators 🚧 ] ( #extra-validators- )
41+ - [ Validators that may be disabled 🆕 ] ( #validators-that-may-be-disabled- )
42+ - [ Extra Validators 🆕 ] ( #extra-validators- )
4343 - [ Validator Usage] ( #validator-usage )
4444 - [ Transforming Validators] ( #transforming-validators )
4545 - [ Validator operations] ( #validator-operations )
@@ -166,8 +166,8 @@ this library:
166166 incomplete arguments. It's better not to guess. Most third party command line
167167 parsers for python actually reimplement command line parsing rather than using
168168 argparse because of this perceived design flaw (recent versions do have an
169- option to disable it). 🆕 The latest version of CLI11 does include partial
170- option matching for option prefixes. This is enabled by
169+ option to disable it). Recent releases of CLI11 do include partial option
170+ matching for option prefixes 🆕 . This is enabled by
171171 ` .allow_subcommand_prefix_matching() ` , along with an example that generates
172172 suggested close matches.
173173- Autocomplete: This might eventually be added to both Plumbum and CLI11, but it
@@ -599,7 +599,7 @@ the two function are that checks do not modify the input whereas transforms can
599599and are executed before any Validators added through ` check ` .
600600
601601CLI11 has several Validators included that perform some common checks. By
602- default the most commonly used ones are available. 🚧 If some are not needed
602+ default the most commonly used ones are available. 🆕 If some are not needed
603603they can be disabled by using
604604
605605``` c++
@@ -625,7 +625,7 @@ of flags.
625625- `CLI::NonNegativeNumber`: Requires the number be greater or equal to 0
626626- `CLI::Number`: Requires the input be a number.
627627
628- #### Validators that may be disabled 🚧
628+ #### Validators that may be disabled 🆕
629629
630630Validators that may be disabled by setting `CLI11_DISABLE_EXTRA_VALIDATORS` to 1
631631or enabled by setting `CLI11_ENABLE_EXTRA_VALIDATORS` to 1. By default they are
@@ -660,7 +660,7 @@ computation time that may not be valuable for some use cases.
660660 the input be convertible to an `unsigned int` regardless of the end
661661 conversion.
662662
663- #### Extra Validators 🚧
663+ #### Extra Validators 🆕
664664
665665New validators will go into code sections that must be explicitly enabled by
666666setting `CLI11_ENABLE_EXTRA_VALIDATORS` to 1
@@ -842,7 +842,7 @@ It is also possible to create a subclass of `CLI::Validator`, in which case it
842842can also set a custom description function, and operation function. One example
843843of this is in the
844844[custom validator example](https://github.com/CLIUtils/CLI11/blob/main/examples/custom_validator.cpp).
845- example. The `check` and `transform` operations can also take a shared_ptr 🚧 to
845+ example. The `check` and `transform` operations can also take a shared_ptr 🆕 to
846846a validator if you wish to reuse the validator in multiple locations or it is
847847mutating and the check is dependent on other operations or is variable. Note
848848that in this case it is not recommended to use the same object for both check
@@ -1076,9 +1076,14 @@ option_groups. These are:
10761076 for processing the app for custom output formats).
10771077- `.parse_order()`: Get the list of option pointers in the order they were
10781078 parsed (including duplicates).
1079- - `.formatter(fmt)`: Set a formatter, with signature
1080- `std::string(const App*, std::string, AppFormatMode)`. See Formatting for more
1081- details.
1079+ - `.formatter(std::shared_ptr<formatterBase> fmt)`: Set a custom formatter for
1080+ help.
1081+ - `.formatter_fn(fmt)`, with signature
1082+ `std::string(const App*, std::string, AppFormatMode)`. See [formatting][] for
1083+ more details.
1084+ - `.config_formatter(std::shared_ptr<Config> fmt)`: set a custom config
1085+ formatter for generating config files, more details available at [Config
1086+ files][config]
10821087- `.description(str)`: Set/change the description.
10831088- `.get_description()`: Access the description.
10841089- `.alias(str)`: set an alias for the subcommand, this allows subcommands to be
@@ -1451,25 +1456,18 @@ The default settings for options are inherited to subcommands, as well.
14511456
14521457### Formatting
14531458
1454- The job of formatting help printouts is delegated to a formatter callable object
1455- on Apps and Options. You are free to replace either formatter by calling
1456- ` formatter(fmt) ` on an ` App ` , where fmt is any copyable callable with the
1457- correct signature. CLI11 comes with a default App formatter functional,
1458- ` Formatter ` . It is customizable; you can set ` label(key, value) ` to replace the
1459- default labels like ` REQUIRED ` , and ` column_width(n) ` to set the width of the
1460- columns before you add the functional to the app or option. You can also
1461- override almost any stage of the formatting process in a subclass of either
1462- formatter. If you want to make a new formatter from scratch, you can do that
1463- too; you just need to implement the correct signature. The first argument is a
1464- const pointer to the in question. The formatter will get a ` std::string ` usage
1465- name as the second option, and a ` AppFormatMode ` mode for the final option. It
1466- should return a ` std::string ` .
1467-
1468- The ` AppFormatMode ` can be ` Normal ` , ` All ` , or ` Sub ` , and it indicates the
1469- situation the help was called in. ` Sub ` is optional, but the default formatter
1470- uses it to make sure expanded subcommands are called with their own formatter
1471- since you can't access anything but the call operator once a formatter has been
1472- set.
1459+ The job of formatting help printouts is delegated to a formatter object. You are
1460+ free to replace the formatter with a custom one by calling ` formatter(fmt) ` on
1461+ an ` App ` . CLI11 comes with a default App formatter, ` Formatter ` . You can
1462+ retrieve the formatter via ` .get_formatter() ` this will return a pointer to the
1463+ current ` Formatter ` . It is customizable; you can set ` label(key, value) ` to
1464+ replace the default labels like ` REQUIRED ` , and ` OPTIONS ` . You can also set
1465+ ` column_width(n) ` to set the width of the columns before you add the functional
1466+ to the app or option. Several other configuration options are also available in
1467+ the ` Formatter ` . You can also override almost any stage of the formatting
1468+ process in a subclass of either formatter. If you want to make a new formatter
1469+ from scratch, you can do that too; you just need to implement the correct
1470+ signature. see [ formatting] [ ] for more details.
14731471
14741472### Subclassing
14751473
@@ -1997,3 +1995,5 @@ try! Feedback is always welcome.
19971995[toml]: https://toml.io
19981996[lyra]: https://github.com/bfgroup/Lyra
19991997[installation]: https://cliutils.github.io/CLI11/book/chapters/installation.html
1998+ [formatting]: https://cliutils.github.io/CLI11/book/chapters/formatting.html
1999+ [config]: https://cliutils.github.io/CLI11/book/chapters/config.html
0 commit comments