diff --git a/CHANGELOG.md b/CHANGELOG.md index a9d6babd..c1417594 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ ## Version 1.4 (in progress) * Added `get_parent()` to access the parent from a subcommand +* `app.allow_ini_extras()` added to allow extras in INI files [#70] +* Adding install support for CMake [#79] +* MakeSingleHeader now works if outside of git [#78] +* Double printing of error message fixed [#77] +* Descriptions can now be written with `config_to_str` [#66] +* Multiline INI comments now supported +* Added `ExistingPath` validator [#73] +* Renamed `requires` to `needs` to avoid C++20 keyword [#75], [#82] + +[#70]: https://github.com/CLIUtils/CLI11/issues/70 +[#75]: https://github.com/CLIUtils/CLI11/issues/75 + +[#82]: https://github.com/CLIUtils/CLI11/pull/82 +[#79]: https://github.com/CLIUtils/CLI11/pull/79 +[#78]: https://github.com/CLIUtils/CLI11/pull/78 +[#77]: https://github.com/CLIUtils/CLI11/pull/77 +[#73]: https://github.com/CLIUtils/CLI11/pull/73 +[#66]: https://github.com/CLIUtils/CLI11/pull/66 ## Version 1.3: Refactor diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fedd4ab..ea0164e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,9 +53,7 @@ file(GLOB CLI_headers "${CMAKE_CURRENT_SOURCE_DIR}/include/CLI/*") # To see in IDE, must be listed for target add_library(CLI11 INTERFACE) target_include_directories(CLI11 INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") -if (CUR_PROJ) - install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/CLI DESTINATION include) -endif() +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/CLI DESTINATION include) # Single file test find_package(PythonInterp) @@ -64,6 +62,7 @@ if(CUR_PROJ AND PYTHONINTERP_FOUND) else() set(CLI_SINGLE_FILE_DEFAULT OFF) endif() + option(CLI_SINGLE_FILE "Generate a single header file (and test)" ${CLI_SINGLE_FILE_DEFAULT}) if(CLI_SINGLE_FILE) find_package(PythonInterp REQUIRED) @@ -76,9 +75,7 @@ if(CLI_SINGLE_FILE) DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/include/CLI11.hpp") set_target_properties(generate_cli_single_file PROPERTIES FOLDER "Scripts") - if (CUR_PROJ) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/CLI11.hpp DESTINATION include) - endif() + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/CLI11.hpp DESTINATION include) add_library(CLI11_SINGLE INTERFACE) target_link_libraries(CLI11_SINGLE INTERFACE CLI11) add_dependencies(CLI11_SINGLE generate_cli_single_file) @@ -98,3 +95,4 @@ option(CLI_EXAMPLES "Build the examples" ${CUR_PROJ}) if(CLI_EXAMPLES) add_subdirectory(examples) endif() + diff --git a/README.md b/README.md index 318b39b9..b16dbc72 100644 --- a/README.md +++ b/README.md @@ -171,7 +171,7 @@ The add commands return a pointer to an internally stored `Option`. If you set t * `->required()`: The program will quit if this option is not present. This is `mandatory` in Plumbum, but required options seems to be a more standard term. For compatibility, `->mandatory()` also works. * `->expected(N)`: Take `N` values instead of as many as possible, only for vector args. If negative, require at least `-N`. -* `->requires(opt)`: This option requires another option to also be present, opt is an `Option` pointer. +* `->needs(opt)`: This option requires another option to also be present, opt is an `Option` pointer. * `->excludes(opt)`: This option cannot be given with `opt` present, opt is an `Option` pointer. * `->envname(name)`: Gets the value from the environment if present and not passed on the command line. * `->group(name)`: The help group to put the option in. No effect for positional options. Defaults to `"Options"`. `""` will not show up in the help print (hidden). @@ -272,7 +272,7 @@ sub.subcommand = true ``` Spaces before and after the name and argument are ignored. Multiple arguments are separated by spaces. One set of quotes will be removed, preserving spaces (the same way the command line works). Boolean options can be `true`, `on`, `1`, `yes`; or `false`, `off`, `0`, `no` (case insensitive). Sections (and `.` separated names) are treated as subcommands (note: this does not mean that subcommand was passed, it just sets the "defaults". To print a configuration file from the passed -arguments, use `.config_to_str(default_also=false)`, where `default_also` will also show any defaulted arguments. +arguments, use `.config_to_str(default_also=false, prefix="", write_description=false)`, where `default_also` will also show any defaulted arguments, `prefix` will add a prefix, and `write_description` will include option descriptions. ## Inheriting defaults diff --git a/include/CLI/Option.hpp b/include/CLI/Option.hpp index 7bc9a4b9..68ac2295 100644 --- a/include/CLI/Option.hpp +++ b/include/CLI/Option.hpp @@ -278,7 +278,7 @@ class Option : public OptionBase