1# Changelog
2
3## Version 2.1: Names and callbacks
4
5The name restrictions for options and subcommands are now much looser, allowing
6a wider variety of characters than before, even spaces can be used (use quotes
7to include a space in most shells). The default configuration parser was
8improved, allowing your configuration to sit in a larger file. And option
9callbacks have a few new settings, allowing them to be run even if the option
10is not passed, or every time the option is parsed.
11
12* Option/subcommand name restrictions have been relaxed. Most characters are now allowed. [#627][]
13* The config parser can accept streams, specify a specific section, and inline comment characters are supported [#630][]
14* `force_callback` & `trigger_on_parse` added, allowing a callback to always run on parse even if not present or every time the option is parsed [#631][]
15* Bugfix(cmake): Only add `CONFIGURE_DEPENDS` if CLI11 is the main project [#633][]
16* Bugfix(cmake): Ensure the cmake/pkg-config files install to a arch independent path [#635][]
17* Bugfix: The single header file generation was missing the include guard. [#620][]
18
19[#620]: https://github.com/CLIUtils/CLI11/pull/620
20[#627]: https://github.com/CLIUtils/CLI11/pull/627
21[#630]: https://github.com/CLIUtils/CLI11/pull/630
22[#631]: https://github.com/CLIUtils/CLI11/pull/631
23[#633]: https://github.com/CLIUtils/CLI11/pull/633
24[#635]: https://github.com/CLIUtils/CLI11/pull/635
25
26### Version 2.1.1: Quick Windows fix
27
28* A collision with `min`/`max` macros on Windows has been fixed. [#642][]
29* Tests pass with Boost again [#646][]
30* Running the pre-commit hooks in development no longer requires docker for clang-format [#647][]
31
32[#642]: https://github.com/CLIUtils/CLI11/pull/642
33[#646]: https://github.com/CLIUtils/CLI11/pull/646
34[#647]: https://github.com/CLIUtils/CLI11/pull/647
35
36## Version 2.1.2: Better subproject builds
37
38* Use `main` for the main branch of the repository [#657][]
39* Bugfix(cmake): Enforce at least C++11 when using CMake target [#656][]
40* Build: Don't run doxygen and CTest includes if a submodule [#656][]
41* Build: Avoid a warning on CMake 3.22 [#656][]
42* Build: Support compiling the tests with an external copy of Catch2 [#653][]
43
44[#653]: https://github.com/CLIUtils/CLI11/pull/653
45[#656]: https://github.com/CLIUtils/CLI11/pull/656
46[#657]: https://github.com/CLIUtils/CLI11/pull/657
47
48## Version 2.0: Simplification
49
50This version focuses on cleaning up deprecated functionality, and some minor
51default changes. The config processing is TOML compliant now. Atomics and
52complex numbers are directly supported, along with other container
53improvements. A new version flag option has finally been added. Subcommands are
54significantly improved with new features and bugfixes for corner cases.  This
55release contains a lot of backend cleanup, including a complete overhaul of the
56testing system and single file generation system.
57
58* Built-in config format is TOML compliant now [#435][]
59  * Support multiline TOML [#528][]
60  * Support for configurable quotes [#599][]
61  * Support short/positional options in config mode [#443][]
62* More powerful containers, support for `%%` separator [#423][]
63* Support atomic types [#520][] and complex types natively [#423][]
64* Add a type validator `CLI::TypeValidator<TYPE>` [#526][]
65* Add a version flag easily [#452][], with help message [#601][]
66* Support `->silent()` on subcommands. [#529][]
67* Add alias section to help for subcommands [#545][]
68* Allow quotes to specify a program name [#605][]
69* Backend: redesigned MakeSingleFiles to have a higher level of manual control, to support future features. [#546][]
70* Backend: moved testing from GTest to Catch2 [#574][]
71* Bugfix: avoid duplicated and missed calls to the final callback [#584][]
72* Bugfix: support embedded newlines in more places [#592][]
73* Bugfix: avoid listing helpall as a required flag [#530][]
74* Bugfix: avoid a clash with WINDOWS define [#563][]
75* Bugfix: the help flag didn't get processed when a config file was required [#606][]
76* Bugfix: fix description of non-configurable subcommands in config [#604][]
77* Build: support pkg-config [#523][]
78
79> ### Converting from CLI11 1.9
80>
81> * Removed deprecated set commands, use validators instead. [#565][]
82> * The final "defaulted" bool has been removed, use `->capture_default_str()`
83>   instead. Use `app.option_defaults()->always_capture_default()` to set this for
84>   all future options. [#597][]
85> * Use `add_option` on a complex number instead of `add_complex`, which has been removed.
86
87[#423]: https://github.com/CLIUtils/CLI11/pull/423
88[#435]: https://github.com/CLIUtils/CLI11/pull/435
89[#443]: https://github.com/CLIUtils/CLI11/pull/443
90[#452]: https://github.com/CLIUtils/CLI11/pull/452
91[#520]: https://github.com/CLIUtils/CLI11/pull/520
92[#523]: https://github.com/CLIUtils/CLI11/pull/523
93[#526]: https://github.com/CLIUtils/CLI11/pull/526
94[#528]: https://github.com/CLIUtils/CLI11/pull/528
95[#529]: https://github.com/CLIUtils/CLI11/pull/529
96[#530]: https://github.com/CLIUtils/CLI11/pull/530
97[#545]: https://github.com/CLIUtils/CLI11/pull/545
98[#546]: https://github.com/CLIUtils/CLI11/pull/546
99[#563]: https://github.com/CLIUtils/CLI11/pull/563
100[#565]: https://github.com/CLIUtils/CLI11/pull/565
101[#574]: https://github.com/CLIUtils/CLI11/pull/574
102[#584]: https://github.com/CLIUtils/CLI11/pull/584
103[#592]: https://github.com/CLIUtils/CLI11/pull/592
104[#597]: https://github.com/CLIUtils/CLI11/pull/597
105[#599]: https://github.com/CLIUtils/CLI11/pull/599
106[#601]: https://github.com/CLIUtils/CLI11/pull/601
107[#604]: https://github.com/CLIUtils/CLI11/pull/604
108[#605]: https://github.com/CLIUtils/CLI11/pull/605
109[#606]: https://github.com/CLIUtils/CLI11/pull/606
110
111## Version 1.9: Config files and cleanup
112
113Config file handling was revamped to fix common issues, and now supports reading [TOML](https://github.com/toml-lang/toml).
114
115Adding options is significantly more powerful with support for things like
116`std::tuple` and `std::array`, including with transforms. Several new
117configuration options were added to facilitate a wider variety of apps.  GCC
1184.7 is no longer supported.
119
120* Config files refactored, supports TOML (may become default output in 2.0) [#362][]
121* Added two template parameter form of `add_option`, allowing `std::optional` to be supported without a special import [#285][]
122* `string_view` now supported in reasonable places [#300][], [#285][]
123* `immediate_callback`, `final_callback`, and `parse_complete_callback` added to support controlling the App callback order [#292][], [#313][]
124* Multiple positional arguments maintain order if `positionals_at_end` is set. [#306][]
125* Pair/tuple/array now supported, and validators indexed to specific components in the objects [#307][], [#310][]
126* Footer callbacks supported [#309][]
127* Subcommands now support needs (including nameless subcommands) [#317][]
128* More flexible type size, more useful `add_complex` [#325][], [#370][]
129* Added new validators `CLI::NonNegativeNumber` and `CLI::PositiveNumber` [#342][]
130* Transform now supports arrays [#349][]
131* Option groups can be hidden [#356][]
132* Add `CLI::deprecate_option` and `CLI::retire_option` functions [#358][]
133* More flexible and safer Option `default_val` [#387][]
134* Backend: Cleaner type traits [#286][]
135* Backend: File checking updates [#341][]
136* Backend: Using pre-commit to format, checked in GitHub Actions [#336][]
137* Backend: Clang-tidy checked again, CMake option now `CL11_CLANG_TIDY` [#390][]
138* Backend: Warning cleanup, more checks from klocwork [#350][], Effective C++ [#354][], clang-tidy [#360][], CUDA NVCC [#365][], cross compile [#373][], sign conversion [#382][], and cpplint [#400][]
139* Docs: CLI11 Tutorial now hosted in the same repository [#304][], [#318][], [#374][]
140* Bugfix: Fixed undefined behavior in `checked_multiply` [#290][]
141* Bugfix: `->check()` was adding the name to the wrong validator [#320][]
142* Bugfix: Resetting config option works properly [#301][]
143* Bugfix: Hidden flags were showing up in error printout [#333][]
144* Bugfix: Enum conversion no longer broken if stream operator added [#348][]
145* Build: The meson build system supported [#299][]
146* Build: GCC 4.7 is no longer supported, due mostly to GoogleTest. GCC 4.8+ is now required. [#160][]
147* Build: Restructured significant portions of CMake build system [#394][]
148
149> ### Converting from CLI11 1.8
150>
151> * Some deprecated methods dropped
152>   * `add_set*` should be replaced with `->check`/`->transform` and `CLI::IsMember` since 1.8
153>   * `get_defaultval` was replaced by `get_default_str`  in 1.8
154> * The true/false 4th argument to `add_option` is expected to be removed in 2.0, use `->capture_default_str()` since 1.8
155
156[#160]: https://github.com/CLIUtils/CLI11/pull/160
157[#285]: https://github.com/CLIUtils/CLI11/pull/285
158[#286]: https://github.com/CLIUtils/CLI11/pull/286
159[#290]: https://github.com/CLIUtils/CLI11/pull/290
160[#292]: https://github.com/CLIUtils/CLI11/pull/292
161[#299]: https://github.com/CLIUtils/CLI11/pull/299
162[#300]: https://github.com/CLIUtils/CLI11/pull/300
163[#301]: https://github.com/CLIUtils/CLI11/pull/301
164[#304]: https://github.com/CLIUtils/CLI11/pull/304
165[#306]: https://github.com/CLIUtils/CLI11/pull/306
166[#307]: https://github.com/CLIUtils/CLI11/pull/307
167[#309]: https://github.com/CLIUtils/CLI11/pull/309
168[#310]: https://github.com/CLIUtils/CLI11/pull/310
169[#313]: https://github.com/CLIUtils/CLI11/pull/313
170[#317]: https://github.com/CLIUtils/CLI11/pull/317
171[#318]: https://github.com/CLIUtils/CLI11/pull/318
172[#320]: https://github.com/CLIUtils/CLI11/pull/320
173[#325]: https://github.com/CLIUtils/CLI11/pull/325
174[#333]: https://github.com/CLIUtils/CLI11/pull/333
175[#336]: https://github.com/CLIUtils/CLI11/pull/336
176[#341]: https://github.com/CLIUtils/CLI11/pull/341
177[#342]: https://github.com/CLIUtils/CLI11/pull/342
178[#348]: https://github.com/CLIUtils/CLI11/pull/348
179[#349]: https://github.com/CLIUtils/CLI11/pull/349
180[#350]: https://github.com/CLIUtils/CLI11/pull/350
181[#354]: https://github.com/CLIUtils/CLI11/pull/354
182[#356]: https://github.com/CLIUtils/CLI11/pull/356
183[#358]: https://github.com/CLIUtils/CLI11/pull/358
184[#360]: https://github.com/CLIUtils/CLI11/pull/360
185[#362]: https://github.com/CLIUtils/CLI11/pull/362
186[#365]: https://github.com/CLIUtils/CLI11/pull/365
187[#370]: https://github.com/CLIUtils/CLI11/pull/370
188[#373]: https://github.com/CLIUtils/CLI11/pull/373
189[#374]: https://github.com/CLIUtils/CLI11/pull/374
190[#382]: https://github.com/CLIUtils/CLI11/pull/382
191[#387]: https://github.com/CLIUtils/CLI11/pull/387
192[#390]: https://github.com/CLIUtils/CLI11/pull/390
193[#394]: https://github.com/CLIUtils/CLI11/pull/394
194[#400]: https://github.com/CLIUtils/CLI11/pull/400
195
196### Version 1.9.1: Backporting fixes
197
198This is a patch version that backports fixes from the development of 2.0.
199
200* Support relative inclusion [#475][]
201* Fix cases where spaces in paths could break CMake support [#471][]
202* Fix an issue with string conversion [#421][]
203* Cross-compiling improvement for Conan.io [#430][]
204* Fix option group default propagation [#450][]
205* Fix for C++20 [#459][]
206* Support compiling with RTTI off [#461][]
207
208[#421]: https://github.com/CLIUtils/CLI11/pull/421
209[#430]: https://github.com/CLIUtils/CLI11/pull/430
210[#450]: https://github.com/CLIUtils/CLI11/pull/450
211[#459]: https://github.com/CLIUtils/CLI11/pull/459
212[#461]: https://github.com/CLIUtils/CLI11/pull/461
213[#471]: https://github.com/CLIUtils/CLI11/pull/471
214[#475]: https://github.com/CLIUtils/CLI11/pull/475
215
216## Version 1.8: Transformers, default strings, and flags
217
218Set handling has been completely replaced by a new backend that works as a Validator or Transformer. This provides a single interface instead of the 16 different functions in App. It also allows ordered collections to be used, custom functions for filtering, and better help and error messages. You can also use a collection of pairs (like `std::map`) to transform the match into an output. Also new are inverted flags, which can cancel or reduce the count of flags, and can also support general flag types. A new `add_option_fn` lets you more easily program CLI11 options with the types you choose. Vector options now support a custom separator. Apps can now be composed with unnamed subcommand support. The final bool "defaults" flag when creating options has been replaced by `->capture_default_str()` (ending an old limitation in construction made this possible); the old method is still available but may be removed in future versions.
219
220* Replaced default help capture: `.add_option("name", value, "", True)` becomes `.add_option("name", value)->capture_default_str()` [#242][]
221* Added `.always_capture_default()` [#242][]
222* New `CLI::IsMember` validator replaces set validation [#222][]
223* `IsMember` also supports container of pairs, transform allows modification of result [#228][]
224* Added new Transformers, `CLI::AsNumberWithUnit` and `CLI::AsSizeValue` [#253][]
225* Much more powerful flags with different values [#211][], general types [#235][]
226* `add_option` now supports bool due to unified bool handling [#211][]
227* Support for composable unnamed subcommands [#216][]
228* Reparsing is better supported with `.remaining_for_passthrough()` [#265][]
229* Custom vector separator using `->delimiter(char)` [#209][], [#221][], [#240][]
230* Validators added for IP4 addresses and positive numbers [#210][] and numbers [#262][]
231* Minimum required Boost for optional Optionals has been corrected to 1.61 [#226][]
232* Positionals can stop options from being parsed with `app.positionals_at_end()` [#223][]
233* Added `validate_positionals` [#262][]
234* Positional parsing is much more powerful [#251][], duplicates supported [#247][]
235* Validators can be negated with `!` [#230][], and now handle tname functions [#228][]
236* Better enum support and streaming helper [#233][] and [#228][]
237* Cleanup for shadow warnings [#232][]
238* Better alignment on multiline descriptions [#269][]
239* Better support for aarch64 [#266][]
240* Respect `BUILD_TESTING` only if CLI11 is the main project; otherwise, `CLI11_TESTING` must be used [#277][]
241* Drop auto-detection of experimental optional and boost::optional; must be enabled explicitly (too fragile) [#277][] [#279][]
242
243> ### Converting from CLI11 1.7
244>
245> * `.add_option(..., true)` should be replaced by `.add_option(...)->capture_default_str()` or `app.option_defaults()->always_capture_default()` can be used
246> * `app.add_set("--name", value, {"choice1", "choice2"})` should become `app.add_option("--name", value)->check(CLI::IsMember({"choice1", "choice2"}))`
247> * The `_ignore_case` version of this can be replaced by adding `CLI::ignore_case` to the argument list in `IsMember`
248> * The `_ignore_underscore` version of this can be replaced by adding `CLI::ignore_underscore` to the argument list in `IsMember`
249> * The `_ignore_case_underscore` version of this can be replaced by adding both functions listed above to the argument list in `IsMember`
250> * If you want an exact match to the original choice after one of the modifier functions matches, use `->transform` instead of `->check`
251> * The `_mutable` versions of this can be replaced by passing a pointer or shared pointer into `IsMember`
252> * An error with sets now produces a `ValidationError` instead of a `ConversionError`
253
254[#209]: https://github.com/CLIUtils/CLI11/pull/209
255[#210]: https://github.com/CLIUtils/CLI11/pull/210
256[#211]: https://github.com/CLIUtils/CLI11/pull/211
257[#216]: https://github.com/CLIUtils/CLI11/pull/216
258[#221]: https://github.com/CLIUtils/CLI11/pull/221
259[#222]: https://github.com/CLIUtils/CLI11/pull/222
260[#223]: https://github.com/CLIUtils/CLI11/pull/223
261[#226]: https://github.com/CLIUtils/CLI11/pull/226
262[#228]: https://github.com/CLIUtils/CLI11/pull/228
263[#230]: https://github.com/CLIUtils/CLI11/pull/230
264[#232]: https://github.com/CLIUtils/CLI11/pull/232
265[#233]: https://github.com/CLIUtils/CLI11/pull/233
266[#235]: https://github.com/CLIUtils/CLI11/pull/235
267[#240]: https://github.com/CLIUtils/CLI11/pull/240
268[#242]: https://github.com/CLIUtils/CLI11/pull/242
269[#247]: https://github.com/CLIUtils/CLI11/pull/247
270[#251]: https://github.com/CLIUtils/CLI11/pull/251
271[#253]: https://github.com/CLIUtils/CLI11/pull/253
272[#262]: https://github.com/CLIUtils/CLI11/pull/262
273[#265]: https://github.com/CLIUtils/CLI11/pull/265
274[#266]: https://github.com/CLIUtils/CLI11/pull/266
275[#269]: https://github.com/CLIUtils/CLI11/pull/269
276[#277]: https://github.com/CLIUtils/CLI11/pull/277
277[#279]: https://github.com/CLIUtils/CLI11/pull/279
278
279## Version 1.7: Parse breakup
280
281The parsing procedure now maps much more sensibly to complex, nested subcommand structures. Each phase of the parsing happens on all subcommands before moving on with the next phase of the parse. This allows several features, like required environment variables, to work properly even through subcommand boundaries.
282Passing the same subcommand multiple times is better supported. Several new features were added as well, including Windows style option support, parsing strings directly, and ignoring underscores in names. Adding a set that you plan to change later must now be done with `add_mutable_set`.
283
284* Support Windows style options with `->allow_windows_style_options`. [#187][] On by default on Windows. [#190][]
285* Added `parse(string)` to split up and parse a command-line style string directly. [#186][]
286* Added `ignore_underscore` and related functions, to ignore underscores when matching names. [#185][]
287* The default INI Config will now add quotes to strings with spaces [#195][]
288* The default message now will mention the help-all flag also if present [#197][]
289* Added `->description` to set Option descriptions [#199][]
290* Mutating sets (introduced in Version 1.6) now have a clear add method, `add_mutable_set*`, since the set reference should not expire [#200][]
291* 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][]
292* Parsing is now done in phases: `shortcurcuits`, `ini`, `env`, `callbacks`, and `requirements`; all subcommands complete a phase before moving on. [#178][]
293* Calling parse multiple times is now officially supported without `clear` (automatic). [#178][]
294* 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][]
295* Use the standard `BUILD_TESTING` over `CLI11_TESTING` if defined [#183][]
296* Cleanup warnings [#191][]
297* Remove deprecated names: `set_footer`, `set_name`, `set_callback`, and `set_type_name`. Use without the `set_` instead. [#192][]
298
299> ### Converting from CLI11 1.6
300>
301> * `->short_circuit()` is no longer needed, just remove it if you were using it - raising an exception will happen in the proper place now without it.
302> * `->add_set*` becomes `->add_mutable_set*` if you were using the editable set feature
303> * `footer`, `name`, `callback`, and `type_name` must be used instead of the `set_*` versions (deprecated previously).
304
305[#178]: https://github.com/CLIUtils/CLI11/pull/178
306[#183]: https://github.com/CLIUtils/CLI11/pull/183
307[#185]: https://github.com/CLIUtils/CLI11/pull/185
308[#186]: https://github.com/CLIUtils/CLI11/pull/186
309[#187]: https://github.com/CLIUtils/CLI11/pull/187
310[#190]: https://github.com/CLIUtils/CLI11/pull/190
311[#191]: https://github.com/CLIUtils/CLI11/pull/191
312[#192]: https://github.com/CLIUtils/CLI11/pull/192
313[#197]: https://github.com/CLIUtils/CLI11/pull/197
314[#195]: https://github.com/CLIUtils/CLI11/issues/195
315[#199]: https://github.com/CLIUtils/CLI11/pull/199
316[#200]: https://github.com/CLIUtils/CLI11/pull/200
317
318### Version 1.7.1: Quick patch
319
320This version provides a quick patch for a (correct) warning from GCC 8 for the windows options code.
321
322* Fix for Windows style option parsing [#201][]
323* Improve `add_subcommand` when throwing an exception [#204][]
324* Better metadata for Conan package [#202][]
325
326[#201]: https://github.com/CLIUtils/CLI11/pull/201
327[#202]: https://github.com/CLIUtils/CLI11/pull/202
328[#204]: https://github.com/CLIUtils/CLI11/pull/204
329
330## Version 1.6: Formatting help
331
332Added a new formatting system [#109][]. You can now set the formatter on Apps. This has also simplified the internals of Apps and Options a bit by separating most formatting code.
333
334* Added `CLI::Formatter` and `formatter` slot for apps, inherited.
335* `FormatterBase` is the minimum required.
336* `FormatterLambda` provides for the easy addition of an arbitrary function.
337* Added `help_all` support (not added by default).
338
339Changes to the help system (most normal users will not notice this):
340
341* Renamed `single_name` to `get_name(false, false)` (the default).
342* The old `get_name()` is now `get_name(false, true)`.
343* The old `get_pname()` is now `get_name(true, false)`.
344* Removed `help_*` functions.
345* Protected function `_has_help_positional` removed.
346* `format_help` can now be chained.
347* Added getters for the missing parts of options (help no longer uses any private parts).
348* Help flags now use new `short_circuit` property to simplify parsing. [#121][]
349
350New for Config file reading and writing [#121][]:
351
352* Overridable, bidirectional Config.
353* ConfigINI provided and used by default.
354* Renamed ini to config in many places.
355* Has `config_formatter()` and `get_config_formatter()`.
356* Dropped prefix argument from `config_to_str`.
357* Added `ConfigItem`.
358* Added an example of a custom config format using [nlohmann/json][]. [#138][]
359
360Validators are now much more powerful [#118][], all built in validators upgraded to the new form:
361
362* A subclass of `CLI::Validator` is now also accepted.
363* They now can set the type name to things like `PATH` and `INT in [1-4]`.
364* Validators can be combined with `&` and `|`.
365* Old form simple validators are still accepted.
366
367Other changes:
368
369* Fixing `parse(args)`'s `args` setting and ordering after parse. [#141][]
370* Replaced `set_custom_option` with `type_name` and `type_size` instead of `set_custom_option`. Methods return `this`. [#136][]
371* Dropped `set_` on Option's `type_name`, `default_str`, and `default_val`. [#136][]
372* Removed `set_` from App's `failure_message`, `footer`, `callback`, and `name`. [#136][]
373* Fixed support `N<-1` for `type_size`. [#140][]
374* Added `->each()` to make adding custom callbacks easier. [#126][]
375* Allow empty options `add_option("-n",{})` to be edited later with `each` [#142][]
376* Added filter argument to `get_subcommands`, `get_options`; use empty filter `{}` to avoid filtering.
377* Added `get_groups()` to get groups.
378* Better support for manual options with `get_option`, `set_results`, and `empty`. [#119][]
379* `lname` and `sname` have getters, added `const get_parent`. [#120][]
380* Using `add_set` will now capture L-values for sets, allowing further modification. [#113][]
381* Dropped duplicate way to run `get_type_name` (`get_typeval`).
382* Removed `requires` in favor of `needs` (deprecated in last version). [#112][]
383* Const added to argv. [#126][]
384
385Backend and testing changes:
386
387* Internally, `type_name` is now a lambda function; for sets, this reads the set live. [#116][]
388* Cleaner tests without `app.reset()` (and `reset` is now `clear`). [#141][]
389* Better CMake policy handling. [#110][]
390* Includes are properly sorted. [#120][]
391* Testing (only) now uses submodules. [#111][]
392
393[#109]: https://github.com/CLIUtils/CLI11/pull/109
394[#110]: https://github.com/CLIUtils/CLI11/pull/110
395[#111]: https://github.com/CLIUtils/CLI11/pull/111
396[#112]: https://github.com/CLIUtils/CLI11/pull/112
397[#113]: https://github.com/CLIUtils/CLI11/issues/113
398[#116]: https://github.com/CLIUtils/CLI11/pull/116
399[#118]: https://github.com/CLIUtils/CLI11/pull/118
400[#119]: https://github.com/CLIUtils/CLI11/pull/119
401[#120]: https://github.com/CLIUtils/CLI11/pull/120
402[#121]: https://github.com/CLIUtils/CLI11/pull/121
403[#126]: https://github.com/CLIUtils/CLI11/pull/126
404[#136]: https://github.com/CLIUtils/CLI11/pull/136
405[#138]: https://github.com/CLIUtils/CLI11/pull/138
406[#140]: https://github.com/CLIUtils/CLI11/pull/140
407[#141]: https://github.com/CLIUtils/CLI11/pull/141
408[#142]: https://github.com/CLIUtils/CLI11/pull/142
409
410[nlohmann/json]: https://github.com/nlohmann/json
411
412### Version 1.6.1: Platform fixes
413
414This version provides a few fixes for special cases, such as mixing with `Windows.h` and better defaults
415for systems like Hunter. The one new feature is the ability to produce "branded" single file output for
416providing custom namespaces or custom macro names.
417
418* Added fix and test for including Windows.h [#145][]
419* No longer build single file by default if main project, supports systems stuck on Python 2.6 [#149][], [#151][]
420* Branding support for single file output [#150][]
421
422[#145]: https://github.com/CLIUtils/CLI11/pull/145
423[#149]: https://github.com/CLIUtils/CLI11/pull/149
424[#150]: https://github.com/CLIUtils/CLI11/pull/150
425[#151]: https://github.com/CLIUtils/CLI11/pull/151
426
427### Version 1.6.2: Help-all
428
429This version fixes some formatting bugs with help-all. It also adds fixes for several warnings, including an experimental optional error on Clang 7. Several smaller fixes.
430
431* Fixed help-all formatting [#163][]
432  * Printing help-all on nested command now fixed (App)
433  * Missing space after help-all restored (Default formatter)
434  * More detail printed on help all (Default formatter)
435  * Help-all subcommands get indented with inner blank lines removed (Default formatter)
436  * `detail::find_and_replace` added to utilities
437* Fixed CMake install as subproject with `CLI11_INSTALL` flag. [#156][]
438* Fixed warning about local variable hiding class member with MSVC [#157][]
439* Fixed compile error with default settings on Clang 7 and libc++ [#158][]
440* Fixed special case of `--help` on subcommands (general fix planned for 1.7) [#168][]
441* Removing an option with links  [#179][]
442
443[#156]: https://github.com/CLIUtils/CLI11/issues/156
444[#157]: https://github.com/CLIUtils/CLI11/issues/157
445[#158]: https://github.com/CLIUtils/CLI11/issues/158
446[#163]: https://github.com/CLIUtils/CLI11/pull/163
447[#168]: https://github.com/CLIUtils/CLI11/issues/168
448[#179]: https://github.com/CLIUtils/CLI11/pull/179
449
450## Version 1.5: Optionals
451
452This version introduced support for optionals, along with clarification and examples of custom conversion overloads. Enums now have been dropped from the automatic conversion system, allowing explicit protection for out-of-range ints (or a completely custom conversion). This version has some internal cleanup and improved support for the newest compilers. Several bugs were fixed, as well.
453
454Note: This is the final release with `requires`, please switch to `needs`.
455
456* Fix unlimited short options eating two values before checking for positionals when no space present [#90][]
457* Symmetric exclude text when excluding options, exclude can be called multiple times [#64][]
458* Support for `std::optional`, `std::experimental::optional`, and `boost::optional` added if `__has_include` is supported [#95][]
459* All macros/CMake variables now start with `CLI11_` instead of just `CLI_` [#95][]
460* The internal stream was not being cleared before use in some cases. Fixed. [#95][]
461* Using an enum now requires explicit conversion overload [#97][]
462* The separator `--` now is removed when it ends unlimited arguments [#100][]
463
464Other, non-user facing changes:
465
466* Added `Macros.hpp` with better C++ mode discovery [#95][]
467* Deprecated macros added for all platforms
468* C++17 is now tested on supported platforms [#95][]
469* Informational printout now added to CTest [#95][]
470* Better single file generation [#95][]
471* Added support for GTest on MSVC 2017 (but not in C++17 mode, will need next version of GTest)
472* Types now have a specific size, separate from the expected number - cleaner and more powerful internally [#92][]
473* Examples now run as part of testing [#99][]
474
475[#64]: https://github.com/CLIUtils/CLI11/issues/64
476[#90]: https://github.com/CLIUtils/CLI11/issues/90
477[#92]: https://github.com/CLIUtils/CLI11/issues/92
478[#95]: https://github.com/CLIUtils/CLI11/pull/95
479[#97]: https://github.com/CLIUtils/CLI11/pull/97
480[#99]: https://github.com/CLIUtils/CLI11/pull/99
481[#100]: https://github.com/CLIUtils/CLI11/pull/100
482
483### Version 1.5.1: Access
484
485This patch release adds better access to the App programmatically, to assist with writing custom converters to other formats. It also improves the help output, and uses a new feature in CLI11 1.5 to fix an old "quirk" in the way unlimited options and positionals interact.
486
487* Make mixing unlimited positionals and options more intuitive [#102][]
488* Add missing getters `get_options` and `get_description` to App [#105][]
489* The app name now can be set, and will override the auto name if present [#105][]
490* Add `(REQUIRED)` for required options [#104][]
491* Print simple name for Needs/Excludes [#104][]
492* Use Needs instead of Requires in help print [#104][]
493* Groups now are listed in the original definition order [#106][]
494
495[#102]: https://github.com/CLIUtils/CLI11/issues/102
496[#104]: https://github.com/CLIUtils/CLI11/pull/104
497[#105]: https://github.com/CLIUtils/CLI11/pull/105
498[#106]: https://github.com/CLIUtils/CLI11/pull/106
499
500### Version 1.5.2: LICENSE in single header mode
501
502This is a quick patch release that makes LICENSE part of the single header file, making it easier to include. Minor cleanup from codacy. No significant code changes from 1.5.1.
503
504### Version 1.5.3: Compiler compatibility
505
506This version fixes older AppleClang compilers by removing the optimization for casting. The minimum version of Boost Optional supported has been clarified to be 1.58. CUDA 7.0 NVCC is now supported.
507
508### Version 1.5.4: Optionals
509
510This version fixes the optional search in the single file version; some macros were not yet defined when it did the search. You can define the `CLI11_*_OPTIONAL` macros to 0 if needed to eliminate the search.
511
512## Version 1.4: More feedback
513
514This 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.
515
516* Lexical cast is now more strict than before [#68][] and fails on overflow [#84][]
517* Added `get_parent()` to access the parent from a subcommand
518* Added `ExistingPath` validator  [#73][]
519* `app.allow_ini_extras()` added to allow extras in INI files [#70][]
520* Multiline INI comments now supported
521* Descriptions can now be written with `config_to_str` [#66][]
522* Double printing of error message fixed [#77][]
523* Renamed `requires` to `needs` to avoid C++20 keyword [#75][], [#82][]
524* MakeSingleHeader now works if outside of git [#78][]
525* Adding install support for CMake [#79][], improved support for `find_package` [#83][], [#84][]
526* Added support for Conan.io [#83][]
527
528[#70]: https://github.com/CLIUtils/CLI11/issues/70
529[#75]: https://github.com/CLIUtils/CLI11/issues/75
530
531[#84]: https://github.com/CLIUtils/CLI11/pull/84
532[#83]: https://github.com/CLIUtils/CLI11/pull/83
533[#82]: https://github.com/CLIUtils/CLI11/pull/82
534[#79]: https://github.com/CLIUtils/CLI11/pull/79
535[#78]: https://github.com/CLIUtils/CLI11/pull/78
536[#77]: https://github.com/CLIUtils/CLI11/pull/77
537[#73]: https://github.com/CLIUtils/CLI11/pull/73
538[#68]: https://github.com/CLIUtils/CLI11/pull/68
539[#66]: https://github.com/CLIUtils/CLI11/pull/66
540
541## Version 1.3: Refactor
542
543This version focused on refactoring several key systems to ensure correct behavior in the interaction of different settings. Most caveats about
544features only working on the main App have been addressed, and extra arguments have been reworked. Inheritance
545of defaults makes configuring CLI11 much easier without having to subclass. Policies add new ways to handle multiple arguments to match your
546favorite CLI programs. Error messages and help messages are better and more flexible. Several bugs and odd behaviors in the parser have been fixed.
547
548* Added a version macro, `CLI11_VERSION`, along with `*_MAJOR`, `*_MINOR`, and `*_PATCH`, for programmatic access to the version.
549* Reworked the way defaults are set and inherited; explicit control given to user with `->option_defaults()` [#48](https://github.com/CLIUtils/CLI11/pull/48)
550* Hidden options now are based on an empty group name, instead of special "hidden" keyword [#48](https://github.com/CLIUtils/CLI11/pull/48)
551* `parse` no longer returns (so `CLI11_PARSE` is always usable) [#37](https://github.com/CLIUtils/CLI11/pull/37)
552* Added `remaining()` and `remaining_size()` [#37](https://github.com/CLIUtils/CLI11/pull/37)
553* `allow_extras` and `prefix_command` are now valid on subcommands [#37](https://github.com/CLIUtils/CLI11/pull/37)
554* Added `take_last` to only take last value passed [#40](https://github.com/CLIUtils/CLI11/pull/40)
555* Added `multi_option_policy` and shortcuts to provide more control than just a take last policy [#59](https://github.com/CLIUtils/CLI11/pull/59)
556* More detailed error messages in a few cases [#41](https://github.com/CLIUtils/CLI11/pull/41)
557* Footers can be added to help [#42](https://github.com/CLIUtils/CLI11/pull/42)
558* Help flags are easier to customize [#43](https://github.com/CLIUtils/CLI11/pull/43)
559* Subcommand now support groups [#46](https://github.com/CLIUtils/CLI11/pull/46)
560* `CLI::RuntimeError` added, for easy exit with error codes [#45](https://github.com/CLIUtils/CLI11/pull/45)
561* The clang-format script is now no longer "hidden" [#48](https://github.com/CLIUtils/CLI11/pull/48)
562* The order is now preserved for subcommands (list and callbacks) [#49](https://github.com/CLIUtils/CLI11/pull/49)
563* Tests now run individually, utilizing CMake 3.10 additions if possible [#50](https://github.com/CLIUtils/CLI11/pull/50)
564* Failure messages are now customizable, with a shorter default [#52](https://github.com/CLIUtils/CLI11/pull/52)
565* Some improvements to error codes [#53](https://github.com/CLIUtils/CLI11/pull/53)
566* `require_subcommand` now offers a two-argument form and negative values on the one-argument form are more useful [#51](https://github.com/CLIUtils/CLI11/pull/51)
567* Subcommands no longer match after the max required number is obtained [#51](https://github.com/CLIUtils/CLI11/pull/51)
568* Unlimited options no longer prioritize over remaining/unlimited positionals [#51](https://github.com/CLIUtils/CLI11/pull/51)
569* Added `->transform` which modifies the string parsed [#54](https://github.com/CLIUtils/CLI11/pull/54)
570* Changed of API in validators to `void(std::string &)` (const for users), throwing providing nicer errors [#54](https://github.com/CLIUtils/CLI11/pull/54)
571* Added `CLI::ArgumentMismatch` [#56](https://github.com/CLIUtils/CLI11/pull/56) and fixed missing failure if one arg expected [#55](https://github.com/CLIUtils/CLI11/issues/55)
572* Support for minimum unlimited expected arguments [#56](https://github.com/CLIUtils/CLI11/pull/56)
573* Single internal arg parse function [#56](https://github.com/CLIUtils/CLI11/pull/56)
574* Allow options to be disabled from INI file, rename `add_config` to `set_config` [#60](https://github.com/CLIUtils/CLI11/pull/60)
575
576> ### Converting from CLI11 1.2
577>
578> * `app.parse` no longer returns a vector. Instead, use `app.remaining(true)`.
579> * `"hidden"` is no longer a special group name, instead use `""`
580> * Validators API has changed to return an error string; use `.empty()` to get the old bool back
581> * Use `.set_help_flag` instead of accessing the help pointer directly (discouraged, but not removed yet)
582> * `add_config` has been renamed to `set_config`
583> * Errors thrown in some cases are slightly more specific
584
585## Version 1.2: Stability
586
587This release focuses on making CLI11 behave properly in corner cases, and with config files on the command line. This includes fixes for a variety of reported issues. A few features were added to make life easier, as well; such as a new flag callback and a macro for the parse command.
588
589* Added functional form of flag [#33](https://github.com/CLIUtils/CLI11/pull/33), automatic on C++14
590* Fixed Config file search if passed on command line [#30](https://github.com/CLIUtils/CLI11/issues/30)
591* Added `CLI11_PARSE(app, argc, argv)` macro for simple parse commands (does not support returning arg)
592* The name string can now contain spaces around commas [#29](https://github.com/CLIUtils/CLI11/pull/29)
593* `set_default_str` now only sets string, and `set_default_val` will evaluate the default string given [#26](https://github.com/CLIUtils/CLI11/issues/26)
594* Required positionals now take priority over subcommands [#23](https://github.com/CLIUtils/CLI11/issues/23)
595* Extra requirements enforced by Travis
596
597## Version 1.1: Feedback
598
599This release incorporates feedback from the release announcement. The examples are slowly being expanded, some corner cases improved, and some new functionality for tricky parsing situations.
600
601* Added simple support for enumerations, allow non-printable objects [#12](https://github.com/CLIUtils/CLI11/issues/12)
602* Added `app.parse_order()` with original parse order ([#13](https://github.com/CLIUtils/CLI11/issues/13), [#16](https://github.com/CLIUtils/CLI11/pull/16))
603* Added `prefix_command()`, which is like `allow_extras` but instantly stops and returns. ([#8](https://github.com/CLIUtils/CLI11/issues/8), [#17](https://github.com/CLIUtils/CLI11/pull/17))
604* Removed Windows warning ([#10](https://github.com/CLIUtils/CLI11/issues/10), [#20](https://github.com/CLIUtils/CLI11/pull/20))
605* Some improvements to CMake, detect Python and no dependencies on Python 2 (like Python 3) ([#18](https://github.com/CLIUtils/CLI11/issues/18), [#21](https://github.com/CLIUtils/CLI11/pull/21))
606
607## Version 1.0: Official release
608
609This is the first stable release for CLI11. Future releases will try to remain backward compatible and will follow semantic versioning if possible. There were a few small changes since version 0.9:
610
611* Cleanup using `clang-tidy` and `clang-format`
612* Small improvements to Timers, easier to subclass Error
613* Move to 3-Clause BSD license
614
615## Version 0.9: Polish
616
617This release focused on cleaning up the most exotic compiler warnings, fixing a few oddities of the config parser, and added a more natural method to check subcommands.
618
619* Better CMake named target (CLI11)
620* More warnings added, fixed
621* Ini output now includes `=false` when `default_also` is true
622* Ini no longer lists the help pointer
623* Added test for inclusion in multiple files and linking, fixed issues (rarely needed for CLI, but nice for tools)
624* Support for complex numbers
625* Subcommands now test true/false directly or with `->parsed()`, cleaner parse
626
627## Version 0.8: CLIUtils
628
629This release moved the repository to the CLIUtils main organization.
630
631* Moved to CLIUtils on GitHub
632* Fixed docs build and a few links
633
634## Version 0.7: Code coverage 100%
635
636Lots of small bugs fixed when adding code coverage, better in edge cases. Much more powerful ini support.
637
638* Allow comments in ini files (lines starting with `;`)
639* Ini files support flags, vectors, subcommands
640* Added CodeCov code coverage reports
641* Lots of small bugfixes related to adding tests to increase coverage to 100%
642* Error handling now uses scoped enum in errors
643* Reparsing rules changed a little to accommodate Ini files. Callbacks are now called when parsing INI, and reset any time results are added.
644* Adding extra utilities in full version only, `Timer` (not needed for parsing, but useful for general CLI applications).
645* Better support for custom `add_options` like functions.
646
647## Version 0.6: Cleanup
648
649Lots of cleanup and docs additions made it into this release. Parsing is simpler and more robust; fall through option added and works as expected; much more consistent variable names internally.
650
651* Simplified parsing to use `vector<string>` only
652* Fixed fallthrough, made it optional as well (default: off): `.fallthrough()`.
653* Added string versions of `->requires()` and `->excludes()` for consistency.
654* Renamed protected members for internal consistency, grouped docs.
655* Added the ability to add a number to `.require_subcommand()`.
656
657## Version 0.5: Windows support
658
659* Allow `Hidden` options.
660* Throw `OptionAlreadyAdded` errors for matching subcommands or options, with ignore-case included, tests
661* `->ignore_case()` added to subcommands, options, and `add_set_ignore_case`. Subcommands inherit setting from parent App on creation.
662* Subcommands now can be "chained", that is, left over arguments can now include subcommands that then get parsed. Subcommands are now a list (`get_subcommands`). Added `got_subcommand(App_or_name)` to check for subcommands.
663* Added `.allow_extras()` to disable error on failure. Parse returns a vector of leftover options. Renamed error to `ExtrasError`, and now triggers on extra options too.
664* Added `require_subcommand` to `App`, to simplify forcing subcommands. Do **not** do `add_subcommand()->require_subcommand`, since that is the subcommand, not the main `App`.
665* Added printout of ini file text given parsed options, skips flags.
666* Support for quotes and spaces in ini files
667* Fixes to allow support for Windows (added Appveyor) (Uses `-`, not `/` syntax)
668
669## Version 0.4: Ini support
670
671* Updates to help print
672* Removed `run`, please use `parse` unless you subclass and add it
673* Supports ini files mixed with command line, tested
674* Added Range for further Plumbum compatibility
675* Added function to print out ini file
676
677## Version 0.3: Plumbum compatibility
678
679* Added `->requires`, `->excludes`, and `->envname` from [Plumbum](http://plumbum.readthedocs.io/en/latest/)
680* Supports `->mandatory` from Plumbum
681* More tests for help strings, improvements in formatting
682* Support type and set syntax in positionals help strings
683* Added help groups, with `->group("name")` syntax
684* Added initial support for ini file reading with `add_config` option.
685* Supports GCC 4.7 again
686* Clang 3.5 now required for tests due to googlemock usage, 3.4 should still work otherwise
687* Changes `setup` for an explicit help bool in constructor/`add_subcommand`
688
689## Version 0.2: Leaner and meaner
690
691* Moved to simpler syntax, where `Option` pointers are returned and operated on
692* Removed `make_` style options
693* Simplified Validators, now only requires `->check(function)`
694* Removed Combiners
695* Fixed pointers to Options, stored in `unique_ptr` now
696* Added `Option_p` and `App_p`, mostly for internal use
697* Startup sequence, including help flag, can be modified by subclasses
698
699## Version 0.1: First release
700
701First release before major cleanup. Still has make syntax and combiners; very clever syntax but not the best or most commonly expected way to work.
702