Commit Graph

657 Commits

Author SHA1 Message Date
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
Sean Robinson
8a90914a2a Add Windows 2022 Clang-cl runner
Several people using clang-cl on Windows are reporting build errors after
a upgrading to v13.  This tries to replicate the error to allow testing
a fix.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-08-11 12:00:31 -07:00
Sean Robinson
566d1df20e Add MacOS 12 CI runner
This expands test environment coverage to two MacOS versions.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-08-04 11:37:02 -07:00
Sean Robinson
0ad03de428 Reenable Windows 2019 MSVC runner
windows-latest changed to Windows 2022 during first quarter of 2022.  This
adds windows-2019 to CI test matrix do that we can catch changes that break
the older configuration.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-08-04 11:35:37 -07:00
Pranav
878bd5edac
Merge pull request #186 from jonas-schulze/emptyline
Add empty line above epilog
2022-07-25 10:16:41 -05:00
Jonas Schulze
ae5de262d2 Add empty line above epilog 2022-07-25 16:43:58 +02:00
Pranav
f0e20fafdc
Merge pull request #183 from eidelen/eidelen-cmake-fetchcontent
Extend Readme with CMake FetchContent integration of argparse.
2022-07-10 09:59:03 -05:00
Adrian Schneider
17d567c283
Extend Readme with CMake FetchContent integration of argparse. 2022-07-09 17:04:02 +02:00
Pranav
4801fd0bdc
Merge pull request #182 from skrobinson/wip-post-2.6-cleanups
Post-2.6 cleanups
2022-07-07 10:19:13 -05:00
Sean Robinson
14097df904 Clean miscellaneous source styling
Clears warnings for the following checks in clang-tidy:
  readability-braces-around-statements
  readability-else-after-return checks

Also adds hints about code style to CONTRIBUTING document.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-07-06 10:03:56 -07:00
Sean Robinson
2460019e2e Update copyright date
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-06-22 14:02:00 -07:00
Pranav Srinivas Kumar
40a3888f15 Bumped version to v2.6 2022-06-22 10:59:52 -07:00
Pranav
24c599dfde
Merge pull request #125 from hokacci/feature/variable-length-nargs
Improve nargs
2022-06-22 10:57:38 -07:00
Yoshihiro Hokazono
ed84d90d89 Move NArgsRange to private: because it is detail of implementation 2022-06-22 09:30:36 +09:00
Yoshihiro Hokazono
25d24c731b SizeRange -> NArgsRange 2022-06-22 09:26:43 +09:00
Yoshihiro Hokazono
acff046fc5 Use optional instead of zero_or_one 2022-06-22 09:24:51 +09:00
Yoshihiro Hokazono
e44023f424 Explain variable-length arguments in README 2022-06-22 07:55:48 +09:00
Yoshihiro Hokazono
7b5084c454 Fix a typo 2022-06-22 07:16:41 +09:00
Yoshihiro Hokazono
df6e7de86a Prefer empty() to size() == 0 2022-06-22 07:15:50 +09:00
Yoshihiro Hokazono
5d6544a04e Retrieve changes on 37a1f3b9e6 2022-06-22 07:11:52 +09:00
Yoshihiro Hokazono
b869b5a209 NArgsPattern -> nargs_pattern (to snake case) 2022-06-22 07:07:59 +09:00
Yoshihiro Hokazono
08943f47ab Merge branch 'master' into feature/variable-length-nargs 2022-06-21 08:36:33 +09:00
Yoshihiro Hokazono
3459eec647 Make throw_* funcs and make validate() clearer 2022-06-21 07:14:09 +09:00
Yoshihiro Hokazono
12fcae66a7 Prefer pre-const to post-const 2022-06-21 06:48:13 +09:00
Yoshihiro Hokazono
0195a5065c Complete "remainig" backward compatibility 2022-06-21 06:45:26 +09:00
Yoshihiro Hokazono
6dfaa1c20c Restore a "remaining" test case for compat 2022-06-21 06:44:29 +09:00
Pranav
234f0cde82
Bumped version to v2.5 2022-05-27 07:30:25 -05:00
Pranav
571f8e3bff
Bumped version to v2.5 2022-05-27 07:29:42 -05:00
Pranav
162866eb4b
Bumped version to v2.5 2022-05-27 07:29:23 -05:00
Pranav
5d093dcdc5
Merge pull request #176 from peckato1/master
Add missing <utility> include
2022-05-19 21:17:32 +02:00
Tomáš Pecka
95d4850683 Add missing <utility> include
After upgrading g++ package to 12.1.0 on archlinux I see the following
compilation error:

  /usr/include/argparse/argparse.hpp: In member function ‘void argparse::ArgumentParser::index_argument(list_iterator)’:
  /usr/include/argparse/argparse.hpp:1167:34: error: ‘as_const’ is not a member of ‘std’; did you mean ‘is_const’?
   1167 |     for (const auto &name : std::as_const(it->m_names)) {
        |                                  ^~~~~~~~
        |                                  is_const

It turns out that std::as_const comes from <utility> header [1] which
was not explicitly included.

[1] https://en.cppreference.com/w/cpp/utility/as_const
2022-05-15 16:04:38 +02:00
Pranav
f5ea927f6b
Merge pull request #174 from ericonr/unused2
Fix remaining unused argument warnings.
2022-05-09 13:58:44 -05:00
Érico Nogueira
82eed31d3f Fix remaining unused argument warnings.
Commit 5c5c55b83c missed one such
occurrence.
2022-05-09 14:35:50 -03:00
Pranav
6ba201e210
Merge pull request #172 from skrobinson/fix-minor-cleanups
Fix minor cleanups
2022-04-27 15:12:36 -07:00
Sean Robinson
8b2357475f Add documentation for add_description and add_epilog
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-04-27 08:01:25 -07:00
Sean Robinson
c4faf29feb Replace cend with std::cend
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-04-27 08:00:51 -07:00
Sean Robinson
37a1f3b9e6 Remove unused code in Argument::validate
As far as I can tell, this statement is never true.

When m_values.size() < *expected, ::consume has already thrown "Too few
arguments..." before ::validate is called.

When m_values.size() > *expected, ArgumentParser::parse_args_internal
has already thrown "Maximum number of positional arguments exceeded"
before ::validate is called.

If ::remaining is used to avoid the last exception, this Argument will
always consume the expected number of values, hence this expression is
again false.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-04-27 08:00:17 -07:00
Pranav
b9dd1ef8e3
Merge pull request #162 from skrobinson/wip-port-aayush749-fixes
Port aayush749 fixes
2022-04-25 16:17:16 -07:00
Pranav
e0d656ec71
Merge pull request #171 from Dennis-Bbg/master
Update README.md
2022-04-21 22:51:07 -05:00
Dennis-Bbg
71a9a7a53e
Update README.md
Fixed the example in section" #### Deciding if the value was given by the user".
2022-04-21 11:52:12 +02:00
Pranav Srinivas Kumar
4af831ef72 Bumped library version to v2.4 2022-04-20 08:37:27 -05:00