Commit Graph

547 Commits

Author SHA1 Message Date
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
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
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
Randolf J
876aa99a97
Remove unnecessary back_inserter 2022-08-31 00:32:01 +02:00
Pranav
c44dde5440
Merge pull request #189 from skrobinson/wip-update-ci-hosts
Update CI hosts and fix clang-cl build
2022-08-13 08:27:21 -05:00
Sean Robinson
a8e2823d68 Replace constexpr generic_strtod with inline const
clang-ci >= 13.0 is failing to compile a constexpr function pointer
assignment.  This is possibly due to strtof (and family) not being
implemented as constexpr in the relevant libc++.

Closes #136
Closes #156

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-08-11 14:02:38 -07:00
Sean Robinson
d8c10a9c79 Add cmake_opts value to allow specifying an alternate toolchain
The new "windows-latest-clang" target does not honor the CXX environment
variable and uses the default MSVC compiler.  This tries to tell cmake to
handle things via a toolset name.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-08-11 13:20:43 -07:00