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

41 Commits

Author SHA1 Message Date
Jesus Briales
41d3c967d7 Add test for non-const version of App::get_options (#337)
After https://github.com/CLIUtils/CLI11/pull/329 the get_options version being used in the test was the non-const.
Forced testing on non-const by using a const-ref to the app.
Also added testing to ensure the list of options of both const and non-const are the same as expected.
2019-10-27 13:53:54 -04: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
eab92ed988 modified option template (#285)
* add some tests with default capture on the two parameter template and some notes about it in the README.md

remove the test from visual studio 2015
vs2015 doesn't seem to properly deal with is_assignable in the cases we care about so make a standalone version that is more direct in what we are doing

add version to appveyor and add some notes to the readme

fix a few test cases to make sure code is covered and test a few other paths

remove unneeded enum streaming operator

add some diagnostic escapes around trait code to eliminate gcc Wnarrowing warnings

work specification of the template operations

remove optional add some templates for options conversions

add the two parameter template for add_option

* Fix some comments from Code review and add more description

* fix case when string_view doesn't work to append to a string.

* This PR also addressed #300

* modify lexical_cast to take  const std::string &, instead of by value to allow string_view in a few cases
2019-07-29 00:19:35 -04:00
Henry Schreiner
d81843002a
To string and default option revamp (#242)
* First streaming version

* Using to_string instead

* Switching to new backend

* Moving to capture function for defaults

* Rename capture_default + _str

* defaultval -> default_str, added always_capture_default

* Fix style

* Adding tests and docs to readme

* Dropping macOS on Travis (supported through Azure)
2019-04-28 22:44:30 +02:00
Philip Top
76d2cde656 Positional argument checks (#262)
* some tweaks with optional

* remove set_results function that was bypassing some of the result processing in some cases of config files.

* add positional Validator example and tests add CLI::Number validator.

* add positional Validator example and tests add CLI::Number validator.

* do some reformatting for style checks and remove auto in test lambda.
2019-04-11 12:04:30 +02: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
e9934e058d add transformer and checkedTransformer (#239)
* add transform and checkedTransform tests

add Transformer and CheckedTransformer validators

* Eliminate the Validator description string, some code cleanup

add tests

Make Validators a full Object and remove friend,  move to descriptions instead of overriding type name.

update validators to actually merge the type strings and use all validators in the type outputs

rework join so it works without the start variable,  allow some forwarding references in the validator types, some tests for non-copyable maps, and transforms

merge the search function and enable use of member search function,  make the pair adapters forwarding instead of copying

* add a few more tests and documentation

fix some gcc 4.7 issues and add a few more test cases and more parts of the README

Work on ReadMe and add Bound validator to clamp values

* updates to README.md

* Add some more in TOC of README and fix style in Option.hpp
2019-03-02 12:24:26 +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
Henry Schreiner
b4910df3d7
Move to using literals in testing (#213) 2019-02-01 11:32:47 +01:00
Henry Schreiner
0086ddd224
Adding Windows style options default on Windows (#190)
* Adding Windows style options default on Windows

* Fixing test defaults on Windows
2019-01-13 08:29:54 +01:00
Philip Top
ce6dc0723e add options to handle windows style command line options (#187)
* add some fields and functions for windows like options
add test cases for windows options and refactor for additional string functions

* try to fix code coverage to 100% again.  add some additional documentation and a few additional test cases to verify documentation

* remove some extra brackets
2019-01-10 23:07:17 +01:00
Henry Fredrick Schreiner
3a2c5112a3 Adding missing tests from #185, should hit full coverage again 2019-01-03 13:12:48 +01:00
Philip Top
a83109002c Add ignore underscore (#185)
* add ignore_underscore test cases and options to app

* add ignore_underscore for add_sets and some more tests for the sets and subcommands

* add some documentation lines and some failing tests

* update readme with ignore_underscore option

* remove failing tests from known issue

* remove empty line for code coverage
2019-01-03 09:22:09 +01:00
Henry Fredrick Schreiner
b2e471ac4d Removing set_ for failure_message, footer, name, and callback 2018-06-18 15:13:59 +02:00
Henry Fredrick Schreiner
101d847c29 Use filter fn to simplify, sort includes 2018-05-06 18:36:33 +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 Schreiner
bc61342d8e
Removing requires (#112) 2018-04-25 18:33:43 -04:00
Henry Fredrick Schreiner
b17f7ce63a Adding a test for coverage 2018-04-12 08:34:22 +02:00
Henry Fredrick Schreiner
8e650c3873 Adding two required functions 2018-04-11 22:18:22 +02:00
Henry Fredrick Schreiner
447bda047f Adding size instead of expected + unchangable 2018-04-04 20:31:52 +02:00
Henry Fredrick Schreiner
eed238364b Expanding tests 2018-04-04 18:29:32 +02:00
Henry Fredrick Schreiner
268c26ad62 Fix #64 by auto-adding symmetric excludes 2018-03-26 10:56:08 +02:00
Henry Schreiner
5186158442
Rename requires to needs (#82)
* Adding fix for #75, rename requires to needs

* Removing check for install commands (should still be run in subproject)
2018-03-08 11:48:40 +01:00
Henry Fredrick Schreiner
4dac11c025 Finishing addition of ->configurable() 2017-11-28 21:28:37 -05:00
Henry Fredrick Schreiner
954c93d585 Using more powerful policy system, to allow git-like -m options 2017-11-28 15:24:37 -05:00
Henry Fredrick Schreiner
88c680a12b Check that no change doesn't throw 2017-11-26 15:11:48 -05:00
Henry Fredrick Schreiner
2c976808a9 Inherit subcommand values, adding getters and tests 2017-11-22 14:13:28 -05:00
Henry Fredrick Schreiner
10772e5d81 Style fix 2017-11-21 17:10:53 -05:00
Henry Fredrick Schreiner
e371a72f13 Adding test to cover get_subcommands(false) 2017-11-21 15:58:10 -05:00
Henry Fredrick Schreiner
fa5da7deaa Adding tests for inhert, a few fixes 2017-11-20 18:07:13 -05:00
Henry Fredrick Schreiner
5f1df630d7 Adding a couple of tests 2017-11-19 15:18:36 -05:00
Henry Fredrick Schreiner
aae40fbf0e Whitespace fixes 2017-09-06 05:51:12 -05:00
Henry Fredrick Schreiner
c6ddbeb281 Fix for spaces in names issue 2017-09-06 05:51:12 -05:00
Henry Fredrick Schreiner
27f718125d Reformat with clang-format 2017-05-31 12:03:05 -04:00
Henry Fredrick Schreiner
101c926dac Adding tidy cleanups (modernize) 2017-05-31 07:38:22 -04:00
Henry Fredrick Schreiner
ee9219e0f8 Adding warnings and fixes, CLI11 target, support for VIM Syntastic 2017-03-27 13:53:57 -04:00
Henry Fredrick Schreiner
7b01535303 Adding a few name tests 2017-03-15 08:19:01 -04:00
Henry Fredrick Schreiner
365315dfdd Adding two more lines to tests 2017-03-14 20:20:03 -04:00
Henry Fredrick Schreiner
cf4f608621 Adding check for invalid positionals 2017-03-09 10:45:52 -05:00
Henry Fredrick Schreiner
58655472f7 IncorrectConstruction 2017-03-08 09:34:08 -05:00
Henry Fredrick Schreiner
e63898df9f Throw errors for duplicate subcommand names, with ignore case too 2017-02-20 15:31:58 -05:00