Releases: CLIUtils/CLI11
Version 1.6.1: Platform fixes
This version provides a few fixes for special cases, such as mixing with Windows.h and better defaults for systems like Hunter. The one new feature is the ability to produce "branded" single file output for providing custom namespaces or custom macro names.
Version 1.6: Formatting help
Added 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.
- Added
CLI::Formatterandformatterslot for apps, inherited. FormatterBaseis the minimum required.FormatterLambdaprovides for the easy addition of an arbitrary function.- Added
help_allsupport (not added by default).
Changes to the help system (most normal users will not notice this):
- Renamed
single_nametoget_name(false, false)(the default). - The old
get_name()is nowget_name(false, true). - The old
get_pname()is nowget_name(true, false). - Removed
help_*functions. - Protected function
_has_help_positionalremoved. format_helpcan now be chained.- Added getters for the missing parts of options (help no longer uses any private parts).
- Help flags now use new
short_circuitproperty to simplify parsing. #121
New for Config file reading and writing #121:
- Overridable, bidirectional Config.
- ConfigINI provided and used by default.
- Renamed ini to config in many places.
- Has
config_formatter()andget_config_formatter(). - Dropped prefix argument from
config_to_str. - Added
ConfigItem. - Added an example of a custom config format using nlohmann/json. #138
Validators are now much more powerful #118, all built in validators upgraded to the new form:
- A subclass of
CLI::Validatoris now also accepted. - They now can set the type name to things like
PATHandINT in [1-4]. - Validators can be combined with
&and|. - Old form simple validators are still accepted.
Other changes:
- Fixing
parse(args)'sargssetting and ordering after parse. #141 - Replaced
set_custom_optionwithtype_nameandtype_sizeinstead ofset_custom_option. Methods returnthis. [#136] - Dropped
set_on Option'stype_name,default_str, anddefault_val. [#136] - Removed
set_from App'sfailure_message,footer,callback, andname. [#136] - Fixed support
N<-1fortype_size. #140 - Added
->each()to make adding custom callbacks easier. #126 - Allow empty options
add_option("-n",{})to be edited later witheach#142 - Added filter argument to
get_subcommands,get_options; use empty filter{}to avoid filtering. - Added
get_groups()to get groups. - Better support for manual options with
get_option,set_results, andempty. #119 lnameandsnamehave getters, addedconst get_parent. #120- Using
add_setwill now capture L-values for sets, allowing further modification. #113 - Dropped duplicate way to run
get_type_name(get_typeval). - Removed
requiresin favor ofneeds(deprecated in last version). #112 - Const added to argv. #126
Backend and testing changes:
Version 1.5.4: Optionals fix
This 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.
Version 1.5.3: Compiler compatibility
This 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.
Version 1.5.2: LICENSE in single header mode
This 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.
Version 1.5.1: Access
This patch release adds better access to the App progromatically, 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.
- Make mixing unlimited positionals and options more intuitive #102
- Add missing getters
get_optionsandget_descriptionto App #105 - The app name now can be set, and will override the auto name if present #105
- Add
(REQUIRED)for required options #104 - Print simple name for Needs/Excludes #104
- Use Needs instead of Requires in help print #104
- Groups now are listed in the original definition order #106
Version 1.5: Optionals
This 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.
Note: This is the final release with requires, please switch to needs.
- Fix unlimited short options eating two values before checking for positionals when no space present #90
- Symmetric exclude text when excluding options, exclude can be called multiple times #64
- Support for
std::optional,std::experimental::optional, andboost::optionaladded if__has_includeis supported #95 - All macros/CMake variables now start with
CLI11_instead of justCLI_#95 - The internal stream was not being cleared before use in some cases. Fixed. #95
- Using an emum now requires explicit conversion overload #97
- The separator
--now is removed when it ends unlimited arguments #100
Other, non-user facing changes:
- Added
Macros.hppwith better C++ mode discovery #95 - Deprecated macros added for all platforms
- C++17 is now tested on supported platforms #95
- Informational printout now added to CTest #95
- Better single file generation #95
- Added support for GTest on MSVC 2017 (but not in C++17 mode, will need next version of GTest)
- Types now have a specific size, separate from the expected number - cleaner and more powerful internally #92
- Examples now run as part of testing #99
Version 1.4: More feedback
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.
- Lexical cast is now more strict than before #68 and fails on overflow #84
- Added
get_parent()to access the parent from a subcommand - Added
ExistingPathvalidator #73 app.allow_ini_extras()added to allow extras in INI files #70- Multiline INI comments now supported
- Descriptions can now be written with
config_to_str#66 - Double printing of error message fixed #77
- Renamed
requirestoneedsto avoid C++20 keyword #75, #82 - MakeSingleHeader now works if outside of git #78
- Adding install support for CMake #79, improved support for
find_package#83, #84 - Added support for Conan.io #83
Version 1.3: Refactor
This version focused on refactoring several key systems to ensure correct behavior in the interaction of different settings. Most caveats about features only working on the main App have been addressed, and extra arguments have been reworked. Inheritance of defaults makes configuring CLI11 much easier without having to subclass. Policies add new ways to handle multiple arguments to match your favorite CLI programs. Error messages and help messages are better and more flexible. Several bugs and odd behaviors in the parser have been fixed.
- Added a version macro,
CLI11_VERSION, along with*_MAJOR,*_MINOR, and*_PATCH, for programmatic access to the version. - Reworked the way defaults are set and inherited; explicit control given to user with
->option_defaults()#48 - Hidden options now are based on an empty group name, instead of special "hidden" keyword #48
parseno longer returns (soCLI11_PARSEis always usable) #37- Added
remaining()andremaining_size()#37 allow_extrasandprefix_commandare now valid on subcommands #37- Added
take_lastto only take last value passed #40 - Added
multi_option_policyand shortcuts to provide more control than just a take last policy #59 - More detailed error messages in a few cases #41
- Footers can be added to help #42
- Help flags are easier to customize #43
- Subcommand now support groups #46
CLI::RuntimeErroradded, for easy exit with error codes #45- The clang-format script is now no longer "hidden" #48
- The order is now preserved for subcommands (list and callbacks) #49
- Tests now run individually, utilizing CMake 3.10 additions if possible #50
- Failure messages are now customizable, with a shorter default #52
- Some improvements to error codes #53
require_subcommandnow offers a two-argument form and negative values on the one-argument form are more useful #51- Subcommands no longer match after the max required number is obtained #51
- Unlimited options no longer prioritize over remaining/unlimited positionals #51
- Added
->transformwhich modifies the string parsed #54 - Changed of API in validators to
void(std::string &)(const for users), throwing providing nicer errors #54 - Added
CLI::ArgumentMismatch#56 and fixed missing failure if one arg expected #55 - Support for minimum unlimited expected arguments #56
- Single internal arg parse function #56
- Allow options to be disabled from INI file, rename
add_configtoset_config#60
Converting from CLI11 1.2:
app.parseno longer returns a vector. Instead, useapp.remaining(true)."hidden"is no longer a special group name, instead use""- Validators API has changed to return an error string; use
.empty()to get the old bool back- Use
.set_help_flaginstead of accessing the help pointer directly (discouraged, but not removed yet)add_confighas been renamed toset_config- Errors thrown in some cases are slightly more specific
Version 1.2: Stability
This 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.
- Added functional form of flag #33, automatic on C++14
- Fixed Config file search if passed on command line #30
- Added
CLI11_PARSE(app, argc, argv)macro for simple parse commands (does not support returning arg) - The name string can now contain spaces around commas #29
set_default_strnow only sets string, andset_default_valwill evaluate the default string given #26- Required positionals now take priority over subcommands #23
- Extra requirements enforced by Travis