1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-30 04:33:53 +00:00

534 Commits

Author SHA1 Message Date
Henry Schreiner
3b95b94406
chore: use PyPI clang-format package, pinned (#647)
* chore: use PyPI clang-format package, pinned

* style: pre-commit.ci fixes

* ci: drop unneeded job

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-09-29 06:15:48 -04:00
Henry Schreiner
b440890eaf
docs: changelog update (#643)
* docs: changelog update

* chore: bump version(s)

* style: pre-commit.ci fixes

* docs: spelling fix

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-09-24 20:37:01 -04:00
Philip Top
4101964033
fixes potential conflict with some windows macro redefinitions of min and max in the validators. (#642) 2021-09-23 19:55:33 -04:00
Henry Schreiner
ac29910a69
docs: prepare for 2.1 (#638)
* docs: changelog update

* docs: prepare for 2.1

* Apply suggestions from code review

Co-authored-by: Philip Top <top1@llnl.gov>

Co-authored-by: Philip Top <top1@llnl.gov>
2021-09-20 15:50:58 -04:00
Philip Top
6c49c299b9
feat: add a more clear force callback (#631)
* Add some missing modifiers on the options to the docs and clarify some of them.

* style: pre-commit.ci fixes

* add a more clear force callback and callback on parse modifier for options.

* update the book with new modifiers

* update documentation and add tests

* style: pre-commit.ci fixes

* more updates to the readme

* update formatting

* rework the trigger_on_parse to better support more complex option types

* fix formatting errors

* Update include/CLI/Option.hpp

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: Henry Schreiner <henry.fredrick.schreiner@cern.ch>
2021-09-20 10:23:39 -04:00
Philip Top
8b785a6c7d
feat: add some capabilities to the config parser and a stream parser (#630)
* add some capabilities to the config parser and a stream parser

* style: pre-commit.ci fixes

* add additional tests for the config parser

* additional tests of config sections and indexing

* style: pre-commit.ci fixes

* add initialization for member variables

* warning and error fixes

* add test for `parse_from_stream`

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-08-22 23:53:06 -04:00
Philip Top
19047d8d68
feat: relaxed option naming (#627)
* add a test for std::map

* add some test of the relaxed naming and other checks

* add validator for aliases, group names and option groups

* add extra tests and update readme

* style: pre-commit.ci fixes

* update the book chapters

* fix codacy issue

* Apply suggestions from code review

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2021-08-22 23:52:00 -04:00
Henry Schreiner
b4f6be31c1
chore: codacity (#621)
* docs: fix some Codacity recommendations

* chore: update copyright year

* style: more codacity fixes

* style: fix issues reported by Codacity
2021-07-16 17:41:46 -04:00
Henry Schreiner
9e247b1a0c
fix: single header file pragma missing (#620) 2021-07-15 09:59:46 -04:00
Henry Schreiner
d55f8fbaf1
style: fix and add spelling check (#615)
* style: fix and add spelling check

* Update .pre-commit-config.yaml
2021-07-14 11:23:02 -04:00
Henry Schreiner
656dda1695 chore: bump version to 2.0.0 2021-07-13 21:08:59 -04:00
Olaf Meeuwissen
2255619b0f
fix: commenting of descriptions with embedded newlines (#592)
* Add configuration output multi-line description tests

This adds tests for the application's description as well as option
groups and subcommands.

See #592.

* Fix commenting of configuration output multi-line descriptions
2021-06-28 13:07:03 -04:00
dryleev
d0a2aa7908
fix: remove duplicated call to subcommand's final_callback (#584)
* Fix excessive call to subcommand's final_callback

When parse_complete_callback_ is set there is an extra call to
run_callback() inside the App::_parse(std::vector<std::string>&) method.
This extra call also excessively calls a final_callback_ (when it is
also set) for the command and (since it is recursive) for it's
subcommands.

This commit adds extra boolean parameter for the run_callback() method
allowing to explicitly suppress calling to final_callback_. The value of
this parameter is also propagated to recursive calls to run_callback().

Fixes #572

* fix: main app should run final_callback, add tests

Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-06-24 09:39:43 -04:00
Philip Top
75f2d7747f
fix: allow quotes to specify a program name with spaces on the single string parse operation. (#605) 2021-06-21 12:16:09 -04:00
Philip Top
f27822deaa
fix: help flag should work even when config file is required (#606) 2021-06-21 12:13:08 -04:00
Philip Top
a8ef5b8d2f
fix: avoid printing description for non configurable subcommand (#604) 2021-06-17 17:42:53 -04:00
Philip Top
2fa8cae9e8
feat: add changeable help message string to version (#601)
add an optional help message string to the version_add flag if desired to override
2021-06-17 12:04:55 -04:00
Philip Top
15bb724e06
fix: make the IncorrectConstruction errors on bad subcommand name more comprehensible. (#602) 2021-06-17 08:37:38 -04:00
Philip Top
ee2b725019
fix: a few issues with config file output (#599)
* fix a few issues with config file output, namely an ability to print a default empty string, and to adjust the quote characters used when quoting strings or characters.

* fix formatting

* Update CMakeLists.txt

* Update README.md
2021-06-16 21:58:03 -04:00
Henry Schreiner
c4f1fc8ea7
refactor!: remove add_complex (#600) 2021-06-16 20:33:22 -04:00
Henry Schreiner
e2e3cb2fed
refactor!: drop defaulted from add_option (#597) 2021-06-16 11:16:22 -04:00
Henry Schreiner
51ea7ebeb0
drop: set (#565)
* refactor!: drop sets

* ci: fix clang 10 build
2021-04-04 01:58:01 -04:00
Max
3eb5e1eedd
fix: rename enum class parameter 'WINDOWS' in detail::Classifier to 'WINDOWS_STYLE' to remove conflicts with cmake default definitions (#563) 2021-04-04 01:57:46 -04:00
Henry Schreiner
f862849488
refactor: new version of MakeSingleFiles (#546)
* refactor: new version of MakeSingleFiles

* fix: use CMake and set version
2021-01-04 17:47:06 -05:00
Philip Top
822f3d6700
fix: add an alias section to the help for subcommands (#545) 2020-12-28 11:02:18 -05:00
Philip Top
f0461525bb
feat: add a silent option to subcommands (#529)
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2020-12-28 11:00:18 -05:00
Philip Top
31be35b241
feat: add a validator that checks for specific types conversion (#526) 2020-12-28 10:58:57 -05:00
D. Fleury
a7902531c9
fix: add multilines array support for TOML (#528)
* Adds multilines array support

* Update include/CLI/Config.hpp

Co-authored-by: David Fleury <david.fleury@expandium.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2020-10-28 12:34:24 -04:00
Philip Top
69674dc91b
fix: help all was showing up in the required list error if requirement are not met. (#530) 2020-10-28 12:33:15 -04:00
Philip Top
89926dc820
feat: support for Atomic types in flags and options (#520) 2020-10-28 11:57:47 -04:00
Alex Dewar
97e5ebe490
fix: don't copy ConfigItems when iterating (#521)
Use a const reference to avoid unnecessary copies. Also constify the
argument to _parse_config.
2020-10-15 21:51:21 -04:00
Philip Top
438eabe5f8
feat: add char type (#449)
add a test for char options

add support for char types to the lexical cast, to allow single character types that make sense, add a integral_conversion operations to simplify the conversions from string to integers and allow discrimination in a few cases with enumerations.
2020-09-30 17:58:39 -04:00
Dominik Steinberger
d3b0b73118
Print input when validation fails (#516)
Co-authored-by: Dominik Steinberger <open-source-libraries@steinberger.io>
2020-09-30 08:57:16 -04:00
Ryan Curtin
26555f9ea2
Grammar fix. (#510) 2020-09-09 14:08:41 -04:00
Philip Top
6aa58d5828
Add an ability to deal handle multiple config files (#494) 2020-09-03 19:42:35 -04:00
Jakob Lover
11141525ac
Customize text between option name and description (#497)
* Added an option to change the text between definition and description

* Added test and readme

* Update Option.hpp

Fixed shadowing issue

* style: fix formatting

Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2020-09-03 19:40:42 -04:00
Henry Schreiner
f1349f12e3 Bump to Version 1.9.1 2020-07-27 22:11:23 -04:00
Philip Top
102e201dc7
fix: a failing test case for toml string_vector processing (#491) 2020-07-27 22:10:18 -04:00
Philip Top
34bd80971b
allow the use of allow_extra_args(false) to specify only a single argument at a time with a container output. (#484) 2020-07-24 00:02:33 -04:00
Sam Hocevar
2337bbf35d
Fix internal header include paths. (#475)
* Fix internal header include paths.

The extra leading "CLI/" part of include directives prevents the inclusion
of CLI.hpp from a relative directory without an extra -I or /I compiler
directive.

* Fix single header generation script.

Files included with "" should be relative to the header file location first.
2020-06-14 11:32:29 -04:00
Sam Hocevar
dccfb06d65
Fix default --version help message capitalisation. (#476)
The default help message for “--help” is capitalised, whereas the one
for “--version” was not:

    -h,--help                   Print this help message and exit
    -V,--version                display program version information and exit
2020-06-14 11:13:54 -04:00
Ondřej Čertík
5c35c182f6
Use e.get_name instead of dynamic_cast (#467)
* Use e.get_name instead of dynamic_cast

Also use std::static_pointer_cast instead of std::dynamic_pointer_cast

Fixes #466

* feat: Allow RTTI to be turned off

* ci: Fix CXX flags

* doc: Adding update to book

Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2020-06-01 21:24:57 -04:00
Philip Top
41a9c294d0
Version add (#452)
* Add a dedicated version option to CLI11 to facilitate use of version flags, similar to help flags

* add some test for the version flag

* update errors and formatting

* clear up gcc 4.8 warnings

* add a few more tests

* fix compiler error

* fix a few comments, and change default version flag to only use "--version"

* remove `version` calls and tests

* formatting and add `std::string version()`  back in.
2020-05-24 23:18:44 -04:00
Philip Top
fff3350254
fix issue with option defaults not propagating to option groups (#450) 2020-05-21 10:07:33 -04:00
Philip Top
747544d7a0
try clang 10 (#459)
* try clang 10

* use helics-builder clang 10 image

* try new image

* try again

* try different flag addition

* try adding cpp20 to visual studio check

* try with the latest flag enabled for visual studio 2019

* try the correct c++ flag

* remove use of std::result_of

* format files
2020-05-21 10:05:32 -04:00
Philip Top
b9a2f320b9
Add windows latest and gcc 8 builds to azure (#446)
* add windows latest and gcc 8 builds to azure

* try adding pr trigger

* try adding something specific for gcc 8

* use interface instead of public

* try C++17 on clang 8

* update the readme with some additional notes about gcc 8

* fix some incorrect doxygen comment formatting

* try using the glibcxx_release value

* debug some code paths to make sure macros are working

* Update readme and fix formatting.

* update formatting for Validators
2020-04-02 01:55:20 -04:00
Christoph Bachhuber
a1ef417b8d Remove cpplint's build/c++11 check
Fix rebase
2020-03-23 09:42:08 -04:00
Philip Top
27da2f952e
Container options (#423)
* Update options.md book chapter and the readme to better reflect current usage and the modifications to the add_options templates.

add support in add_option for wrapper types, such as std::optional, boost::optional or other types with a value_type trait.  Add support for generalized containers beyond vector,  add support for nested tuples and vectors, and complex numbers directly in add_option.  This includes several new type traits and object categories.

Upgrade the google test version to better support templated tests.

add support for vector argument separator `%%`

* update formatting to match recent changes

* Apply suggestions from code review

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2020-03-22 14:06:34 -04:00
Philip Top
f346f29802
Config short (#443)
* add a get_single_name function for options, and allow short names to be used for configuration output.

* add config input to handle short and positional options

* add some tests about short options and positional options in config files

* allow use of envname_ in config files

* update doc book and readme with fixes

* formatting update

* some formatting updates

* add some notes on the config file generation

* just try modifying a comment
2020-03-22 13:58:46 -04:00
Philip Top
967bfe0e02
Set the default configuration file output as TOML (#435)
* Set the default configuration file output as TOML

* update formatting
2020-03-06 00:11:59 -05:00