Commit Graph

701 Commits

Author SHA1 Message Date
Sean Robinson
f710bbdacf Add operator bool for ArgumentParser
This allows checking whether user input was processed into the parser
or any attached subparsers.

Closes #212

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-10-10 15:26:42 -07:00
Sean Robinson
0c83c631c5 Update CMake version in README example for FetchContent
FetchContent_MakeAvailable was added in CMake v3.14.  Also includes
end-of-line whitespace clean-ups.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-10-06 13:57:34 -07:00
Sean Robinson
7af2342d94 Remove link library from add_sample function
Resolves the following build error:

  CMake Error at CMakeLists.txt:26 (ADD_EXECUTABLE):
    Target "ARGPARSE_SAMPLE_custom_assignment_characters" links to target
    "argparse::argparse" but the target was not found.  Perhaps a
    find_package() call is missing for an IMPORTED target, or an
    ALIAS target is missing?

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-10-06 13:57:25 -07:00
Pranav
537f5e0d3c
Merge pull request #215 from skrobinson/feat-pr-tidy
Add clang-tidy analysis of pull requests
2022-10-06 11:48:44 -05:00
Sean Robinson
f1d75bbb32 Remove unneeded explicit Compare function from map declarations
std::less<Key> is the standard's default comparison function, we do not
need to re-declare the same function.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-10-06 09:18:47 -07:00
Sean Robinson
99057b09a1 Add clang-tidy analysis of pull requests
This action runs clang-tidy with results saved to a file which is then
parsed in stage two to post code comments.  This multistage process lets
us post PR comments on code from forks.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-10-05 15:22:44 -07:00
Pranav
e9ae471ea4
Merge pull request #209 from skrobinson/fix-issue-208
Fix issue 208
2022-09-23 12:57:02 -05:00
Pranav
168bc9d189
Merge pull request #210 from skrobinson/feat-add-sample-licenses
Add an explicit MIT license to each sample source file
2022-09-23 12:56:10 -05:00
Sean Robinson
74b95bc11a Add an explicit MIT license to each sample source file
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-09-23 08:10:06 -07:00
Sean Robinson
50e3afd81d Replace vector::operator[] use with vector::front
This is mostly a style change to match other parts of the code.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-09-23 08:05:33 -07:00
Sean Robinson
2a15178bb7 Include canonical argument name in nargs range validation error
The name of a positional argument is never used.

Closes #208

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-09-23 07:54:58 -07:00
Pranav Srinivas Kumar
997da92556 Bumped version to v2.9 2022-09-21 19:24:04 -07:00
Pranav
d6c3f3b704
Updated cmake command for building samples 2022-09-21 21:17:24 -05:00
Pranav
ce0b491571
Merge pull request #206 from p-ranav/feature/metavar_help_and_usage
METAVAR, Improved help, Samples (Based on #187)
2022-09-21 21:16:37 -05:00
Pranav Srinivas Kumar
b1c7483cf5 Added additional samples and fixed parse_known_args API 2022-09-21 19:08:06 -07:00
Pranav Srinivas Kumar
6f1e89885e Added nargs to help output, added test samples 2022-09-21 18:48:11 -07:00
Pranav Srinivas Kumar
05232b7487 Started adding samples 2022-09-21 18:09:25 -07:00
Pranav Srinivas Kumar
3b9df0b1e7 Added support for metavar and improved help/usage based on #187 2022-09-21 18:01:36 -07:00
Pranav
5a83edd3c4
Added build and test instructions 2022-09-21 13:10:14 -05:00
Pranav
176b7e7961
Merge pull request #205 from p-ranav/feature/prefix_chars
Closes #67: option-value syntax support
2022-09-21 13:03:36 -05:00
Pranav Srinivas Kumar
d56515f6df Removed static from lambda function, updated copy constructor for m_assign_chars 2022-09-21 10:58:25 -07:00
Pranav Srinivas Kumar
632ca2fcf8 Added prefix_chars and assign_chars to README #67 2022-09-21 09:53:30 -07:00
Pranav Srinivas Kumar
66730967aa Added support for custom prefix characters #67 2022-09-21 09:48:48 -07:00
Pranav
2335da9478
Merge pull request #204 from p-ranav/bugfix/warnings
Added -Wshadow and -Wconversion to CXX_FLAGS and fixed warnings (related to #159)
2022-09-21 09:48:25 -05:00
Pranav Srinivas Kumar
616062e2bf Added -Wshadow and -Wconversion to CXX_FLAGS and fixed warnings 2022-09-21 07:43:46 -07:00
Pranav
1ebaccc350
Merge pull request #203 from p-ranav/feature/option_equals_value
Allow --option=value form of arguments (Refactored #185)
2022-09-21 09:32:05 -05:00
Pranav Srinivas Kumar
b2d2a58510 Removed test file 2022-09-21 07:25:18 -07:00
Pranav
8c91f1a290
Added option=value example to table of contents 2022-09-21 09:24:17 -05:00
Pranav Srinivas Kumar
6dd2a3cf4b Added example to README for option=value support 2022-09-21 07:23:02 -07:00
Pranav Srinivas Kumar
20095a697a Added option=value support using #185 2022-09-21 06:54:34 -07:00
Pranav
d512563c45
Merge pull request #202 from p-ranav/bugfix/94_implicit_conversions
Closes #94
2022-09-21 08:29:14 -05:00
Pranav Srinivas Kumar
14287af007 Closes #94 2022-09-21 06:23:42 -07:00
Pranav
4dbc910a49
Merge pull request #201 from p-ranav/feature/parse_known_args
parse_known_args
2022-09-21 07:59:12 -05:00
Pranav Srinivas Kumar
6a3c6e06e6 Added 'Parse Known Args' section 2022-09-21 05:54:21 -07:00
Pranav Srinivas Kumar
6e23d5b22e Closes #181 2022-09-21 05:47:47 -07:00
Pranav Srinivas Kumar
4f10f378c5 Bumped version to v2.8 2022-09-20 21:21:06 -07:00
Pranav
c91fc8477a
Renamed section Subparsers -> Subcommands 2022-09-20 23:18:14 -05:00
Pranav
c879553fba
Fixed indentation in table of contents 2022-09-20 23:17:41 -05:00
Pranav Srinivas Kumar
793fbcde16 Added is_subcommand_used helper function 2022-09-20 21:15:58 -07:00
Pranav Srinivas Kumar
e35ce54028 Added example for subparser 2022-09-20 20:48:01 -07:00
Pranav Srinivas Kumar
6ed180f89e Updated copy constructor and added parser path to correctly print program name in help for subparsers 2022-09-20 20:45:32 -07:00
Pranav Srinivas Kumar
6c7da857b6 Added table of contents to README and clang formatted code 2022-09-20 20:27:24 -07:00
Pranav Srinivas Kumar
6987a83ad5 Updated help to print subcommands list 2022-09-20 20:09:42 -07:00
Pranav Srinivas Kumar
2f2858a8a7 Draft implementation of subparsers #42 2022-09-20 19:54:29 -07:00
Pranav Srinivas Kumar
327e16c61b Bumped to version v2.7 2022-09-18 07:14:36 -07:00
Pranav Srinivas Kumar
e9099de7d4 Removed contributors list. See https://github.com/p-ranav/argparse/graphs/contributors for full list 2022-09-18 07:13:49 -07:00
Pranav
af282c0f68
Updated example to use std::string instead of cstring for default value 2022-09-07 08:30:22 -05:00
Pranav
b8160a86b5
Merge pull request #192 from jun-sheaf/patch-2
Use references for any_cast
2022-09-03 13:14:01 -05:00
Randolf Jung
357068156e Use references for any_cast 2022-09-03 19:56:33 +02:00
Pranav
68abf03688
Merge pull request #191 from jun-sheaf/patch-1
Remove unnecessary back_inserter
2022-08-30 19:16:43 -05:00