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

50 Commits

Author SHA1 Message Date
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
Henry Fredrick Schreiner
56c85b1e22 Recovering GCC 4.7 support 2017-02-07 14:33:37 -05:00
Henry Fredrick Schreiner
1bf66bc3e5 Moved to storing unique_ptr of Options, better support for --help 2017-02-07 14:00:03 -05:00
Henry Fredrick Schreiner
494a65f812 Dropping Make syntax, moving to pointers from combiners, structured errors.
This mostly is cleanup, with fewer alternative methods and more standard syntax, avoiding the use of the namespace all the time. Validators are simpler and are added through `->check()`.

Defaults are automatic, and can be specified with a final arg to the options.

Expected arguments and required arguments are now accessed through a pointer to option.

Option now can be checked as a bool to see if the argument was passed.

Errors have better organisation.
2017-02-06 20:52:12 -05:00
Henry Fredrick Schreiner
a12a94c4c1 Separate files, plus way to combine 2017-02-06 09:54:41 -05:00