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

13 Commits

Author SHA1 Message Date
Philip Top
6b7f6a7480 Value initialization (#416)
* work on the flags book chapter and making sure the values are initialized properly.

* Fix initialization of values used in flags or options

* update some formatting and more brace initialization

* update more formatting and fix a incorrect initializer

* more formatting and some error fixes

* more formatting

* Small formatting fix

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2020-01-27 09:42:03 -06:00
Henry Schreiner
d5cd986046 Rename size_t -> std::size_t 2019-12-31 10:35:24 -05:00
Henry Fredrick Schreiner
2244ecc3f3 Adding and fixing Weffc++ 2019-11-29 21:49:05 -05:00
Philip Top
343a730a04 Add needs to subcommand (#317)
* add a needs method to the app/subcommand

* add some needs subcommand tests

* add a few more subcommand tests for needs and alias

* fix shadow warnings

* add some tests of the error pathways and fix a few anomalous conditions on the Option excludes function

* add needs and alias functions in the readme

* add some tests of ignore_case and underscore with the alias operations

* add a few more test cases for needs option groups

* add callback tests with needs and add a few comments in the readme

* update formatting

* add error checks on the aliases and restrictions on valid names for subcommands and aliases

* add checks for matching subcommands and improve error return values to include the offending name

* add some tests of the alias errors

* add some more tests to check subcommand name matching during addition

* add some additional tests and remove a redundant chunk of codes

* add some more checks of subcommand name overlap in option_groups

* allow disabled subcommand to bypass name matching check
2019-10-25 10:21:34 -04:00
Philip Top
17ddce2fb2 Add classification type traits (#286)
This cleans up the type checking a bit and makes it more readable, along with some other cleanup.

* start work on trying to clean up the type traits for which lexical cast overload to use

* fix readme issue and make the condition tests a little clearer

* add a check for out of range errors on boolean conversions

* Fix capitalization and some comments on option functions

* fix a few code analysis warnings for VS2019
2019-07-30 09:46:10 -04:00
Philip Top
49e93cac3c add docs for remove_subcommand and add_subcommand in option_group
add some test of the remove_excludes functions

add test for Issue #256

add remove_subcommand fail test

add remove_subcommand function and add_subcommand to option_group and some tests associated with them.
2019-03-22 17:56:36 -04:00
Philip Top
059f6ef254 change add_option_function to take a std::function with void return type and update some corresponding test cases and documentation
Allow option groups to use ignore_case ignore_underscore for inheritance

Allow option groups to specify allow_extras even if the parent app doesn't in which case extra options flow down into the option_group.
2019-03-22 17:56:36 -04:00
Philip Top
3f9fafd916 make immediate_callback inheritable, add tests for that and for valid strings, some cleanup in the README.md
Apply suggestions from code review

Co-Authored-By: phlptp <top1@llnl.gov>
allow callbacks for option_groups, and allow some other characters as flags
2019-03-22 17:56:36 -04:00
Philip Top
6ad2641d63 Add excludes test on option_groups 2019-03-22 17:56:36 -04:00
Philip Top
fe7e84f29a add some unit tests for the fallthrough_parent command
rework return values from _parse_* function to return true if the value was processed false otherwise, this simplified the logic and got rid of the pulling and clearing of the missing fields from option groups.

add TriggerOff and TriggerOn helper functions and some tests for them

add shapes example of multiple callbacks in order.

allow specification of callbacks that get executed immediately on completion of parsing of subcommand

add tests for enabled/disabled by default

add _get_fallthrough_parent.  To get the most appropriate parent to fallthrough to

add enabled and disabled by default functions

add positional_arity example

Add a pre_parse_callback_ for apps.  The Pre parse callback takes an argument for the number of remaining arguments left to process, and will execute prior to parsing for subcommands, and after the first option parse for option_groups.
2019-03-22 17:56:36 -04:00
Henry Fredrick Schreiner
be8a08f25d Clean up warnings 2019-03-03 16:53:03 +01:00
Philip Top
2cd58ef8cf add a test of duplicate named subcommands in different option_groups and make sure that executes them over running the same one twice. (#247)
make duplicate subcommands work
2019-03-03 16:46:32 +01: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