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

90 Commits

Author SHA1 Message Date
Henry Schreiner
c9123811d1
CLI::IsMember (#222)
* Adding first draft of Sets

Use IsMember now

Using IsMember as backend for Set

Non-const validator backend

Move set tests to set

Clearer inits

* Drop shortcut

Tighten up classes a bit for MSVC

Check with GCC 4.8 too

* Simpler templates, but more of them

Dropping more type safety for older compilers

Shortcut string set

* Adding shortcut init

Making g++ 4.7 docker image happy

Fix Clang tidy issue with last commit

Adding one more shortcut, adding a couple of tests

* Dropping dual pointer versions of code

* Smarter shortcut syntax

* Adding slighly faster choices

* Cleanup to make InMember simpler

* Drop choices for now, adding some tests

* ValidationError is now always the error from a validator

* Support for other types of initializer lists, including enums

* Factor out type utilities, single version of IsMember code

* Adding a few tests for #224

* Minor cleanup for Validation Error

* Adding tests, moved deprecated tests

* Docs updates
2019-02-19 09:56:02 +01:00
Philip Top
3d7de7d25c Add documentation for positionals_at_end documentation clarification on some of the validators (#223)
Add a flag that specifies that positional options can only occur as the last arguments of a command line.  Will generate an ExtrasError if all positional arguments are not captured, regardless of the state of allow_extras.
2019-02-12 09:43:41 +01:00
Philip Top
c8bd97156b click-style boolean flags (#219)
Updates to the readme

update the readme with some documentation

add a few more tests to complete code coverage

update with count strings in flags instead an array of strings for each count

add the '!' shortcut notation.  add some checks on the help output

allow the false flag syntax to support --option{false}

add a bool lexical cast to make everything consistent when converting to a bool.  Moved a few functions around

make the command line behave like the INI file wrt flags, flag options are allowed to process the value so `--flag=false` actually does the expected thing.

Add functionality similar to click style argument that allow specifying a false flag that when used generates a false result on the flag.
2019-02-09 23:51:38 +01:00
Rafi Wiener
59ae97d064 Change default delimiter to '\0' instead of space (#221)
This maintains the CLI11 previous way of working.

Signed-off-by: Rafi Wiener <rafiw@mellanox.com>
2019-02-08 18:06:54 +01:00
Rafi Wiener
048f968504 Add support for delimiter when parsing vector (#209)
This commit allows parsing any char separated list given by the user.
E.g app -a 1,2,3
std::vector<int> params;
app.add_option("-a", params, "Parse the params", ',');

Signed-off-by: Rafi Wiener <rafiw@mellanox.com>

add tests for delimiter parsing

Signed-off-by: Rafi Wiener <rafiw@mellanox.com>

Fixing style, adding docker version of clang-format
2019-02-06 15:15:31 +01:00
Henry Schreiner
b4910df3d7
Move to using literals in testing (#213) 2019-02-01 11:32:47 +01:00
Philip Top
b26894458b add some more tests of custom parsers and adjustments to the README
Add a test that creates and uses a custom parser to store a value

add a check around regex to see if it is working

fix warning in AppTest from gcc
2019-01-31 23:53:04 +01:00
Philip Top
1a6ed01d87 add some additional tests for the failure case, and update the README with documentation on the new function.
use bracket initialization

add callback functions for options with the derived values
2019-01-30 16:44:04 +01:00
Philip Top
f542179924 add = and : escape detect with different branch in escape_detect code. The tests were verified to fail if the fix was not in place. 2019-01-25 09:21:47 +01:00
Henry Schreiner
02c49388d7
Making mutable sets explicit (#200) 2019-01-24 10:10:37 +01:00
Henry Fredrick Schreiner
66fedad044 Adding check for Windows definition order match from #187 2019-01-11 13:23:28 +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
Philip Top
30c2e327d1 Add single string parsing (#186)
* add Tests and ability to handle program file inclusion in the single string.

add the ability to deal with a single string in the parse command and handle quoted string appropriately

* Add extra test cases for full coverage, clear up escape quote sequencing and handling of extra spaces
2019-01-06 10:30:49 +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 Schreiner
c3d8d4a2d0
Adding new parse layout (#178)
* Adding new parse layout

* Dropping shortcurcuit from help, since it has special override

* Refactor help call

* Dropping shortcurcuit since it is not needed now that help has custom behavoir

* Dropping MaxSubcommand error (cannot occur)
2019-01-02 22:16:42 +01:00
Henry Schreiner
a78f5bcdcf
Dropping links if option removed (#179) 2018-11-13 17:12:48 +01:00
Henry Fredrick Schreiner
a63609102a Support empty lambdas 2018-06-27 18:58:16 +02:00
Henry Fredrick Schreiner
85aa0e7813 Dropping last (required) usages of clear 2018-06-27 12:26:03 +02:00
Henry Fredrick Schreiner
8635c4d0eb Dropping reset in favor of clear 2018-06-27 12:26:03 +02:00
Henry Fredrick Schreiner
3cb75b903e Correcting the logic for sized types in vectors 2018-06-26 18:15:17 +02:00
Sean Fisk
5fe44fc713 Add failing test for repeated multi-argument options 2018-06-26 18:15:17 +02:00
Henry Schreiner
bf2bc39c30 Rename to set_* on options and add return this
Now use type_name and type_size instead of set_custom_option.
2018-06-18 15:13:59 +02:00
Henry Fredrick Schreiner
47d5ed1453 Adding each() 2018-05-10 18:49:38 +02:00
Henry Fredrick Schreiner
101d847c29 Use filter fn to simplify, sort includes 2018-05-06 18:36:33 +02:00
Henry Schreiner
3917b1ab59
Sets by reference (#114)
* Adding const & access to sets

* Adding set reference option

* One missing line in coverage
2018-05-02 16:06:20 +02:00
Henry Schreiner
bc61342d8e
Removing requires (#112) 2018-04-25 18:33:43 -04:00
Henry Fredrick Schreiner
9d41ddef83 Better mixing of positionals and unlimited options (#102) 2018-04-10 14:18:00 +02:00
Henry Fredrick Schreiner
e12a295e33 Fixing some warnings 2018-04-09 14:58:51 +02:00
Henry Fredrick Schreiner
8f1215873c Allow -- to end unlimited options 2018-04-09 13:55:53 +02:00
Henry Fredrick Schreiner
0959430e57 Adding test for #87 2018-04-08 15:47:36 +02:00
Henry Fredrick Schreiner
5d9a5636bc Removing enum conversion 2018-04-07 06:58:21 +02:00
Henry Fredrick Schreiner
9a1ac48a67 Adding info to changelog 2018-04-04 20:31:52 +02:00
Henry Fredrick Schreiner
0c3df9150c Adding FetchContent on CMake 3.11 2018-04-04 20:31:52 +02:00
Henry Fredrick Schreiner
f059528559 Support for multi-size MultiOptionPolicies 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
bea833bbcd Adding and fixing more warnings 2018-03-26 11:48:23 +02:00
Henry Fredrick Schreiner
2b4780d74a Add --option=value test for #90, as well 2018-03-26 08:31:14 +02:00
Henry Fredrick Schreiner
aa7c01ff5d Adding test and fix for #90 2018-03-25 17:56:46 +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
d6b983a2a7 Adding back short-cuts 2017-11-28 15:24: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
958b0e511e Fixing -N values min count throw 2017-11-26 15:11:48 -05:00
Henry Fredrick Schreiner
6638549adb Adding check for -2 opts 2017-11-26 15:11:48 -05:00
Henry Fredrick Schreiner
1b3a4b63c8 Combining parse functions for short and long 2017-11-26 15:11:48 -05:00
Henry Fredrick Schreiner
133c7d5075 Allow suggestions for number of args 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
3d309dc0be Adding fail if required values missing 2017-11-25 19:03:03 -05:00
Henry Fredrick Schreiner
44de4de118 Adding test, fixing option name to single name in message 2017-11-24 21:11:28 -05:00
Henry Fredrick Schreiner
85857d99e1 Return string for error message in validators 2017-11-24 21:11:28 -05:00