1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-29 20:23:55 +00:00

54 Commits

Author SHA1 Message Date
Christoph Bachhuber
88b0bc4d95 Add include_what_you_use to cpplint checks (#414)
* Add build/include_what_you_use to cpplint checks

* Fix all cpplint build/include_what_you_use issues
2020-01-26 14:01:54 -06:00
Christoph Bachhuber
efbdd604af Refactor clang-tidy (#389)
* Make CI fail with readability-container-size-empty flag

* Make CI fail with cppcoreguidelines-owning-memory flag

* Add all google checks, exclude specific ones

* Apply clang-tidy fixes

* Make timer constructors explicit

* Add check for unscoped namespaces

* Replace unscoped namespace by using-declaration

* Replace unscoped namespace by using-declaration
2020-01-08 17:32:30 -05:00
Henry Schreiner
d5cd986046 Rename size_t -> std::size_t 2019-12-31 10:35:24 -05:00
Philip Top
418b7175f5 Type size refactor (#325)
* add expanded type_size specification

* add some more checks for type_size_max

* continued work on getting type sizes more flexible

* make some more tweaks to option to split up validate and reduce sections

* git rid of exceptions on the type_size functions exceptions,  allow any number to be entered for the min and max and don't make a distinction between flags and other types.

* add expected count

* add the allow extra args flag in an option

* start working in allow_extra_args

* write some stuff in the book,  and continue working on the failing test cases

* fix a few more of the helpers tests

* a few more test cases running

* all tests pass, fixing calls in ini files

* get vector<pair> working and all tests passing

* change callback to use reference to remove allocation and copy operation

* add support and test for vector<vector<X>>

* change Validators_ to validators_ for consistency

* fix linux warnings and errors by reording some templates and adding some typename keywords

* add support for std::vector<X> as the cross conversion type so optional<std::vector<X>> is supported using the full template of add_option.

* a few more test cases to take care of some coverage gaps

* add missing parenthesis

* add some more tests for coverage gaps

* add test for flag like option

* add transform test for `as<X>` function and make it pass through the defaults

* add a few more tests and have vector default string interpreted correctly.

* add test for defaulted integer,  and route default string for defaulted value which would otherwise be empty

* some code cleanup and comments and few more test coverage gap tests

* add more tests and fix a few bugs on the type size and different code paths

* remove path in results by fixing the clear of options so they go back to parsing state.

* get coverage back to 100%

* clang_tidy, and codacy fixes

* reorder the lexical_conversion definitions

* update some formatting

* update whitespace on book chapter
2019-11-10 05:36:16 +10:30
Philip Top
06ab2d0fbd Footer callback (#309)
fix incorrect parenthesis

update some clang-tidy fixes mainly else after return but a few conversions from into to bool

add extra newline before footer

add an extra field to the extra Error

add a footer callback for help operations
2019-08-18 19:51:14 -04:00
Philip Top
0631189b4d Option groups (#227)
* change the move function to _move_option and add an additional test

add a validation check on min options to make sure it is even possible to succeed.

add some additional tests to cover code paths and potential errors.

add a number of additional tests and checks and fix some issues with the add function in option_groups

clean up example and help formatting

add option_groups example to play with

move create_option_group to a member function using a dummy template

add some optionGroup tests

add min and max options calls and an associated Error call

* add ranges example,  add excludes to app for options and subcommands.

* add some tests on ranges, and some subcommand tests with exclusion

* add tests in optionGroups for some invalid inputs

* add required option to subcommands and option_groups

* add disabled flag

* add disable option to subcommands and some more tests

* start work on ReadMe modifications

* update the readme with descriptions of function and methods added for option_groups

* clear up gcc 4.7 warnings

* some update to the Readme and a few more warnings fixed

* Minor readme touchup
2019-03-01 17:43:08 +01:00
Philip Top
ed5cd89636 remove template for operator[] and adjust some tests
add some comments in readME about performance

move operator[] to return const Option *

Apply suggestions from code review

Co-Authored-By: phlptp <top1@llnl.gov>

update readme and add some IniTests and fix a bug from the tests

add_flag_callback

add a few tests to capture the different paths

fix incorrectly updated CMAKE file, and add some subcommand test for option finding

add disable_flag_override and work out some kinks in the find option functions

add some more tests and fix a few bugs in as<> function for options

Allow general flag types and default values, add shortcut notation for retrieving values
2019-02-23 07:40:41 +01:00
Philip Top
663d93c792 Clear up Wshadow warnings from gcc 4.9 (#191)
* Clear up Wshadow warnings from gcc 4.9.  Most of these were local variable names with the same name as a member function.
Also a few spelling fixes and adding some std::move around some of the arguments when appropriate.

* Touchup
2019-01-13 09:12:48 +01:00
Henry Fredrick Schreiner
9b54b6e0fe Undef error macros at end of file 2018-05-18 10:45:30 +02:00
Henry Fredrick Schreiner
d46c2c5727 Adding Config class 2018-05-09 16:08:32 +02:00
Henry Fredrick Schreiner
952f2913e3 First attempt at formatter (app and option)
in progress: formatters

Getting closer

Working on apps

One test actually runs

All builds, added filter functions

Reverting a few behavours as needed

Repairs

All tests pass

Fixing error with adding help flag

Labels are simpler mappings, normalized setters

Adding help_all

Adding a few more tests

One more line tested

Adding one more check

Adding to readme

Simplify naming

Adding default constructors

Fixing spacing issues with subcommand all printout

Adding a couple of tests
2018-04-30 08:17:31 -04:00
Henry Fredrick Schreiner
bd890e24a1 A few more explicit constructors 2018-04-13 14:15:09 +02:00
Henry Schreiner
b23275358a
Adding nicer header with LICENSE to single file version (#107)
* Adding nicer header with LICENSE to single file version

* Adding badges

* Clean up sh files

* Adding explicit in a few places

* More fixes from codacy
2018-04-13 14:07:32 +02:00
Henry Fredrick Schreiner
f059528559 Support for multi-size MultiOptionPolicies 2018-04-04 20:31:52 +02:00
Henry Fredrick Schreiner
447bda047f Adding size instead of expected + unchangable 2018-04-04 20:31:52 +02:00
Lucas Czech
378eb3406c Fix space in help output. 2018-01-07 17:26:53 +01:00
Henry Fredrick Schreiner
4dac11c025 Finishing addition of ->configurable() 2017-11-28 21:28:37 -05:00
Henry Fredrick Schreiner
c1fb53f00d Moving error messages definitions to Error.h 2017-11-28 21:28:37 -05:00
Henry Fredrick Schreiner
b010775051 Fix ArgumentMismatch missing public (makes it hard to catch) 2017-11-27 17:24:08 -05:00
Henry Fredrick Schreiner
fc69345f2f Improve one more message 2017-11-26 22:40:40 -05:00
Henry Fredrick Schreiner
133c7d5075 Allow suggestions for number of args 2017-11-26 15:11:48 -05:00
Henry Fredrick Schreiner
3e651e3b7e Moved more string processing to Error 2017-11-26 15:11:48 -05:00
Henry Fredrick Schreiner
f6c9ce6109 Moving code to Error, better ArgumentMismatch throwing 2017-11-26 15:11:48 -05:00
Henry Fredrick Schreiner
4d5bff2393 Adding ArgumentMismatch, changable improvement 2017-11-26 15:11:48 -05:00
Henry Fredrick Schreiner
c6fd8f4d83 A few warning fixes 2017-11-22 22:41:14 -05:00
Henry Fredrick Schreiner
a958ffece2 Dropping name from simple print, better seperation for Errors
Some error codes are renamed
2017-11-22 22:41:14 -05:00
Henry Fredrick Schreiner
02548a64d8 Adding the ability to set custom failure messages 2017-11-22 13:45:18 -05:00
Henry Fredrick Schreiner
0395467d48 Making RuntimeError a ParseError 2017-11-20 12:31:14 -05:00
Henry Fredrick Schreiner
0bca8fdd30 Adding docs, fixing examples for usage 2017-11-20 12:31:14 -05:00
Marcus Brinkmann
852929f0f6 Support runtime errors. 2017-11-20 12:31:14 -05:00
Henry Fredrick Schreiner
94b3355b9a Adding more detail to error messages 2017-11-19 15:18:48 -05:00
Henry Fredrick Schreiner
916cde58cf BSD licence, preparing for 1.0 release 2017-06-01 09:23:04 -04:00
Henry Fredrick Schreiner
27f718125d Reformat with clang-format 2017-05-31 12:03:05 -04:00
Henry Fredrick Schreiner
60934c8a27 Fixing include order 2017-05-31 10:59:25 -04:00
Henry Fredrick Schreiner
c94aa406a6 Fixing namespace endings 2017-05-31 10:50:16 -04:00
Henry Fredrick Schreiner
32a70aeb9e Adding easier-to-subclass error type 2017-04-27 16:37:26 -04:00
Henry Fredrick Schreiner
1619e863a2 Fixing name CLIUtils 2017-03-25 16:54:57 -04:00
Henry Fredrick Schreiner
e29bd785c6 Change CLTools -> CLITools 2017-03-23 16:11:54 -04:00
Henry Fredrick Schreiner
cb2646a56c Moving to new location 2017-03-23 15:55:23 -04:00
Henry Fredrick Schreiner
90a02425f0 Match docs to recent changes 2017-03-17 14:52:58 -04:00
Henry Fredrick Schreiner
a6621ff8a9 Changing ErrorCodes -> ExitCodes 2017-03-17 14:45:04 -04:00
Henry Fredrick Schreiner
17564cec05 Scoped enum for errors 2017-03-17 11:34:10 -04:00
Henry Fredrick Schreiner
cf4f608621 Adding check for invalid positionals 2017-03-09 10:45:52 -05:00
Henry Fredrick Schreiner
fd313fcadd Adding ability to “leave out” options (optional). Rename RequierdError to ExtrasError 2017-02-20 11:18:51 -05:00
Henry Fredrick Schreiner
bf0b18a9f4 After discussion, LGPL seems to be the correct license 2017-02-17 19:58:06 -05:00
Henry Fredrick Schreiner
ce6c942008 Adding doxygen docs 2017-02-15 09:35:54 -05:00
Henry Fredrick Schreiner
15c6ee5f3d Added Range and ValidationError, Refactor throwing errors to Option instead of App for Validation 2017-02-13 16:28:35 -05:00
Henry Fredrick Schreiner
f4bf6d7226 Adding requires, excludes, and getenv (untested) 2017-02-12 14:04:36 -05:00
Henry Fredrick Schreiner
905c23bcd0 Change license 2017-02-12 13:01:43 -05:00
Henry Fredrick Schreiner
aac712b754 Adding ini parser, cleanup test CMake 2017-02-09 17:18:24 -05:00