You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -187,7 +188,7 @@ Set handling has been completely replaced by a new backend that works as a Valid
187
188
* Support for composable unnamed subcommands [#216][]
188
189
* Reparsing is better supported with `.remaining_for_passthrough()`[#265][]
189
190
* Custom vector separator using `->delimiter(char)`[#209][], [#221][], [#240][]
190
-
* Validators added for IP4 addresses and positive numbers [#210] and numbers [#262][]
191
+
* Validators added for IP4 addresses and positive numbers [#210][] and numbers [#262][]
191
192
* Minimum required Boost for optional Optionals has been corrected to 1.61 [#226][]
192
193
* Positionals can stop options from being parsed with `app.positionals_at_end()`[#223][]
193
194
* Added `validate_positionals`[#262][]
@@ -248,9 +249,9 @@ Passing the same subcommand multiple times is better supported. Several new feat
248
249
* The default message now will mention the help-all flag also if present [#197][]
249
250
* Added `->description` to set Option descriptions [#199][]
250
251
* Mutating sets (introduced in Version 1.6) now have a clear add method, `add_mutable_set*`, since the set reference should not expire [#200][]
251
-
* Subcommands now track how many times they were parsed in a parsing process. `count()` with no arguments will return the number of times a subcommand was encountered. [#179][]
252
-
* Parsing is now done in phases: `shortcurcuits`, `ini`, `env`, `callbacks`, and `requirements`; all subcommands complete a phase before moving on. [#179][]
253
-
* Calling parse multiple times is now officially supported without `clear` (automatic). [#179][]
252
+
* Subcommands now track how many times they were parsed in a parsing process. `count()` with no arguments will return the number of times a subcommand was encountered. [#178][]
253
+
* Parsing is now done in phases: `shortcurcuits`, `ini`, `env`, `callbacks`, and `requirements`; all subcommands complete a phase before moving on. [#178][]
254
+
* Calling parse multiple times is now officially supported without `clear` (automatic). [#178][]
254
255
* Dropped the mostly undocumented `short_circuit` property, as help flag parsing is a bit more complex, and the default callback behavior of options now works properly. [#179][]
255
256
* Use the standard `BUILD_TESTING` over `CLI11_TESTING` if defined [#183][]
256
257
* Cleanup warnings [#191][]
@@ -262,7 +263,7 @@ Passing the same subcommand multiple times is better supported. Several new feat
262
263
> *`->add_set*` becomes `->add_mutable_set*` if you were using the editable set feature
263
264
> *`footer`, `name`, `callback`, and `type_name` must be used instead of the `set_*` versions (deprecated previously).
@@ -473,7 +474,7 @@ This version fixes the optional search in the single file version; some macros w
473
474
474
475
This version adds lots of smaller fixes and additions after the refactor in version 1.3. More ways to download and use CLI11 in CMake have been added. INI files have improved support.
475
476
476
-
* Lexical cast is now more strict than before [#68] and fails on overflow [#84][]
477
+
* Lexical cast is now more strict than before [#68][] and fails on overflow [#84][]
477
478
* Added `get_parent()` to access the parent from a subcommand
478
479
* Added `ExistingPath` validator [#73][]
479
480
*`app.allow_ini_extras()` added to allow extras in INI files [#70][]
Copy file name to clipboardexpand all lines: README.md
+4-3
Original file line number
Diff line number
Diff line change
@@ -355,7 +355,7 @@ Before parsing, you can set the following options:
355
355
*`->transform(Validator)`: Uses a Validator object to do the transformation see [Validators](#validators) for a description of available Validators and how to create new ones.
356
356
*`->each(void(const std::string &)>`: Run this function on each value received, as it is received. It should throw a `ValidationError` if an error is encountered.
357
357
*`->configurable(false)`: Disable this option from being in a configuration file.
358
-
*`->capture_default_str()`: Store the current value attached and display it in the help string.
358
+
*`->capture_default_str()`: Store the current value attached and display it in the help string.
359
359
*`->default_function(std::string())`: Advanced: Change the function that `capture_default_str()` uses.
360
360
*`->always_capture_default()`: Always run `capture_default_str()` when creating new options. Only useful on an App's `option_defaults`.
361
361
*`->default_str(string)`: Set the default string directly. This string will also be used as a default value if no arguments are passed and the value is requested.
@@ -384,7 +384,7 @@ If `allow_windows_style_options()` is specified in the application or subcommand
384
384
*`/file filename` (space)
385
385
*`/file:filename` (colon)
386
386
*`/long_flag:false` (long flag with : to override the default value)
387
-
*Windows style options do not allow combining short options or values not separated from the short option like with `-` options
387
+
* Windows style options do not allow combining short options or values not separated from the short option like with `-` options
388
388
389
389
Long flag options may be given with an `=<value>` to allow specifying a false value, or some other value to the flag. See [config files](#configuration-file) for details on the values supported. NOTE: only the `=` or `:` for windows-style options may be used for this, using a space will result in the argument being interpreted as a positional argument. This syntax can override the default values, and can be disabled by using `disable_flag_override()`.
If this is called with no arguments, it will remove the configuration file option (like `set_help_flag`). Setting a configuration option is special. If it is present, it will be read along with the normal command line arguments. The file will be read if it exists, and does not throw an error unless `required` is `true`. Configuration files are in [TOML] format by default 🆕, though the default reader can also accept files in INI format as well. It should be noted that CLI11 does not contain a full TOML parser but can read strings from most TOML file and run them through the CLI11 parser. Other formats can be added by an adept user, some variations are available through customization points in the default formatter. An example of a TOML file:
732
+
If this is called with no arguments, it will remove the configuration file option (like `set_help_flag`). Setting a configuration option is special. If it is present, it will be read along with the normal command line arguments. The file will be read if it exists, and does not throw an error unless `required` is `true`. Configuration files are in [TOML][] format by default 🆕, though the default reader can also accept files in INI format as well. It should be noted that CLI11 does not contain a full TOML parser but can read strings from most TOML file and run them through the CLI11 parser. Other formats can be added by an adept user, some variations are available through customization points in the default formatter. An example of a TOML file:
733
733
734
734
```toml
735
735
# Comments are supported, using a #
@@ -1064,3 +1064,4 @@ CLI11 was developed at the [University of Cincinnati][] to support of the [GooFi
Copy file name to clipboardexpand all lines: book/README.md
+6-7
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# CLI11: An introduction
2
2
3
-
This gitbook is designed to provide an introduction to using the CLI11 library to write your own command line programs. The library is designed to be clean, intuitive, but powerful. There are no requirements beyond C++11 support (and even `<regex>` support not required). It works on Mac, Linux, and Windows, and has 100% test coverage on all three systems. You can simply drop in a single header file (`CLI11.hpp` available in [releases]) to use CLI11 in your own application. Other ways to integrate it into a build system are listed in the [README][].
3
+
This gitbook is designed to provide an introduction to using the CLI11 library to write your own command line programs. The library is designed to be clean, intuitive, but powerful. There are no requirements beyond C++11 support (and even `<regex>` support not required). It works on Mac, Linux, and Windows, and has 100% test coverage on all three systems. You can simply drop in a single header file (`CLI11.hpp` available in [releases][]) to use CLI11 in your own application. Other ways to integrate it into a build system are listed in the [README][].
4
4
5
5
The library was inspired the Python libraries [Plumbum][] and [Click][], and incorporates many of their user friendly features. The library is extensively documented, with a [friendly introduction][README], this tutorial book, and more technical [API docs][].
6
6
@@ -51,16 +51,15 @@ You can use subcommands, as well. Subcommands support callback lambda functions
51
51
52
52
Reading/producing `.ini` files for configuration is also supported, as is using environment variables as input. The base `App` can be subclassed and customized for use in a toolkit (like [GooFit][]). All the standard shell idioms, like `--`, work as well.
53
53
54
-
CLI11 was developed at the [University of Cincinnati] in support of the [GooFit][] library under [NSF Award 1414736][NSF 1414736]. It was featured in a [DIANA/HEP][] meeting at CERN. Please give it a try! Feedback is always welcome.
54
+
CLI11 was developed at the [University of Cincinnati][] in support of the [GooFit][] library under [NSF Award 1414736][NSF 1414736]. It was featured in a [DIANA/HEP][] meeting at CERN. Please give it a try! Feedback is always welcome.
Copy file name to clipboardexpand all lines: book/chapters/config.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -176,7 +176,7 @@ See [`examples/json.cpp`](https://github.com/CLIUtils/CLI11/blob/master/examples
176
176
177
177
## Triggering Subcommands
178
178
179
-
Configuration files can be used to trigger subcommands if a subcommand is set to configure. By default configuration file just set the default values of a subcommand. But if the `configure()` option is set on a subcommand then the if the subcommand is utilized via a `[subname]` block in the configuration file it will act as if it were called from the command line. Subsubcommands can be triggered via [subname.subsubname]. Using the `[[subname]]` will be as if the subcommand were triggered multiple times from the command line. This functionality can allow the configuration file to act as a scripting file.
179
+
Configuration files can be used to trigger subcommands if a subcommand is set to configure. By default configuration file just set the default values of a subcommand. But if the `configure()` option is set on a subcommand then the if the subcommand is utilized via a `[subname]` block in the configuration file it will act as if it were called from the command line. Subsubcommands can be triggered via `[subname.subsubname]`. Using the `[[subname]]` will be as if the subcommand were triggered multiple times from the command line. This functionality can allow the configuration file to act as a scripting file.
180
180
181
181
For custom configuration files this behavior can be triggered by specifying the parent subcommands in the structure and `++` as the name to open a new subcommand scope and `--` to close it. These names trigger the different callbacks of configurable subcommands.
0 commit comments