Commit Graph

613 Commits

Author SHA1 Message Date
cobyj33
90945c5c95 Add to readme FetchContent section to automatically turn off building tests and samples 2023-10-25 19:12:11 -05:00
Pranav
5614b96e5a
Merge pull request #292 from BitMaskMixer/gcc_warning_fix
CMakefile: Use -Wpedantic, -Werror and -Wextra for compilation in gcc. Fixed warnings
2023-10-20 18:46:07 -05:00
Christoph Hindermann
6c4bddb990 CMakefile: Use -Wpedantic, -Werror and -Wextra for compilation in gcc. Fixed warnings 2023-10-20 19:57:12 +02:00
Pranav
57b63b09fa
Merge pull request #290 from Arthapz/master
Add C++20 module
2023-10-20 08:06:14 -05:00
Pranav
694ca7ff34
Merge pull request #291 from kianmeng/fix-typos
Fix typos
2023-10-20 08:01:59 -05:00
Arthur LAURENT
24569f69e8 fix module compilation with clang on windows when std module is disabled 2023-10-20 10:53:39 +02:00
Arthur LAURENT
7f5de9ab25
fix import std support 2023-10-19 21:50:00 +02:00
Arthur LAURENT
67a4e91da9
fix module and headerfile installation 2023-10-19 20:35:56 +02:00
Arthur LAURENT
2040a740a3
use function style target declaration 2023-10-19 18:57:11 +02:00
Kian-Meng Ang
aa25a2f3ac Fix typos
Found via `codespell -L seh`
2023-10-19 13:09:11 +08:00
Arthur LAURENT
9788dee9a2
fix basename for tests without module 2023-10-15 19:16:55 +02:00
Arthur LAURENT
a47dd910f3
format lua code with 4 space instead of tabs 2023-10-15 19:10:35 +02:00
Arthur LAURENT
3435365979
add xmake support for easier C++20 module compilation and testing 2023-10-15 18:56:53 +02:00
Arthur LAURENT
6723c81877
update test to use module when WITH_MODULE macro is set 2023-10-15 18:51:56 +02:00
Arthur LAURENT
23aff1938a
add argparse C++20 module 2023-10-15 17:13:56 +02:00
Arthur LAURENT
7a13042264
use inline constexpr instead of static constexpr for free constants 2023-10-15 17:08:22 +02:00
Pranav
b0930ab028
Merge pull request #268 from fanurs/align_multiline_message
Fix issue #248: Align multiline help messages
2023-07-11 08:15:12 -05:00
Fanurs
e82653c2d9 Fixed test for multiline help message alignment 2023-04-22 19:23:17 -04:00
Fanurs
19d85eadb0 Passed test for multiline help message alignment 2023-04-22 15:16:47 -04:00
Fanurs
5595375786 Changed padding from \t to spaces 2023-04-22 15:15:39 -04:00
Fanurs
aa996952bb Fixed clang-tidy issues
See https://github.com/p-ranav/argparse/pull/259#pullrequestreview-1284243420
2023-04-22 02:35:46 -04:00
Pranav
557948f123
Update README.md 2023-03-29 11:54:38 -05:00
Pranav
0b513829ac
Merge pull request #264 from skrobinson/feat-exit-choice
Add exit_on_default_arguments parameter to ArgumentParser
2023-03-29 11:54:15 -05:00
Sean Robinson
9377e0d3b2 Use return in place of exit() in README and samples
Only those places in the README where an error is explicitly found in the
main function have been updated.  Other uses of exit are left untouched as
there is not enough context to know if return will work in that location.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2023-03-29 08:42:12 -07:00
Pranav
34ba129d5e
Merge pull request #263 from nick20201/std_numeric_limits_max
Resolves the std::numeric_limits<std::size_t>::max)()} error
2023-03-22 11:40:37 -05:00
Sean Robinson
0ae3c7d919 Add exit_on_default_arguments parameter to ArgumentParser
Allows users to opt-out of std::exit call in default arguments without
needing to replace with new --help and --version arguments.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2023-03-22 09:07:45 -07:00
Nicholas Treffer
1c266d2791 Resolves the std::numeric_limits<std::size_t>::max)()} error
similar to this one https://github.com/microsoft/cppwinrt/issues/479
2023-03-17 14:16:08 +13:00
Pranav
e516556733
Merge pull request #254 from skrobinson/fix-maintenance
Various maintenance tasks
2023-02-19 10:29:59 -06:00
Pranav
e077137cd2
Merge pull request #253 from skrobinson/fix-string-crash
Fix crash with char[] default values
2023-02-19 10:29:53 -06:00
He Shiming
3d7596765b implements column-aligned multi-line help message for arguments (issue #248) 2023-01-30 19:28:07 +08:00
Sean Robinson
d0beb40d64 Fix cmake option command by including help text
The option() command expects a help string between the variable and the
initial value.

Closes #241

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2023-01-17 14:26:14 -07:00
Sean Robinson
be705d191b Remove cmake option for removable '-v'
This was made obsolete by commit ea1f7ef663.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2023-01-17 14:15:05 -07:00
Sean Robinson
6974f46851 Revert "Use references for any_cast"
This attempts to fix Issue #225-1 by reverting the change that turned a
std::bad_any_cast exception into a nullptr.

Reverts commit 357068156e.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2023-01-17 13:57:59 -07:00
Sean Robinson
7ed952f4fe Add test for ArgumentParser::get() with inappropriate type
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2023-01-17 13:57:59 -07:00
Sean Robinson
d845381028 Fix Argument bool bit fields
The intent of ": 1" is to use individual bits to store the bool state of
these class values. Because true != 0, this worked. But it was likely to
bite someone sometime. (My bad: 0fe17e22f6.)

This commit also adds m_accepts_optional_like_value to the bit field and
sets the default false value in the constructor.

Because we cannot set a default value during declaration (until C++20).
make sure future coders know to set the preferred default in the
constructor.

Closes #213

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2023-01-17 13:57:59 -07:00
Sean Robinson
04ac1fe366 Refactor Parent Parsers documentation
This replaces the verbiage copied from the Python argparse documentation
and makes the code sample more concrete. This illustrates how to avoid the
multiple help output problem reported in #165.

Closes #165

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2023-01-17 13:57:59 -07:00
Sean Robinson
a5ab5b0ce8 Update minimum supported MSVC version
https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170

Closes #228

Reported-by: @c0rn1ie
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2023-01-17 13:57:59 -07:00
Pranav
15d745f584
Merge pull request #255 from serge-sans-paille/fix/cmake-install-dir
Install cmake export file in CMAKE_INSTALL_DIR
2023-01-17 08:48:50 -06:00
serge-sans-paille
a442a74569 Install cmake export file in CMAKE_INSTALL_DIR
Per https://cmake.org/cmake/help/latest/guide/importing-exporting/index.html#exporting-targets
this is the standard way to do so, no need to hack CMAKE_INSTALL_LIBDIR_ARCHIND
2023-01-15 22:03:22 +01:00
Sean Robinson
cb3da173f6 Fix crash with char[] default values
Closes #249

Reported-by: @pfeatherstone
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2023-01-05 13:02:40 -07:00
Pranav
af0f7cb25f
Merge pull request #252 from skrobinson/fix-help-arg-docs
Highlight default arguments and their default behavior
2022-12-20 14:29:32 -06:00
Sean Robinson
ecba90a4eb Highlight default arguments and their default behavior
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-12-20 09:44:34 -07:00
Pranav
d1d006f8f1
Merge pull request #245 from skrobinson/feat-at-function
Add ArgumentParser::at to retrieve arguments and subparsers
2022-11-30 08:55:47 -06:00
Sean Robinson
5f22faa973 Add ArgumentParser::at to retrieve arguments and subparsers
This allows updating attached object properties without holding external
references to the various Argument and ArgumentParser objects.

Closes #227

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-11-29 13:43:16 -07:00
Pranav
6992b3b0df
Merge pull request #244 from skrobinson/fix-tidy-checks
Fix tidy checks
2022-11-29 14:37:09 -06:00
Sean Robinson
a832ac3496 Analyze only argparse header in PR clang-tidy action
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-11-29 10:40:39 -07:00
Sean Robinson
4f47631525 Update clang-tidy configuration to only include main header
The previous regex would also analyze doctest.hpp.  We don't need to check
a vendored library.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
2022-11-29 10:40:29 -07:00
Pranav
f901d9edb4
Merge pull request #238 from aayush749/fix#235
Added a fix for issue #235
2022-11-13 16:14:44 -06:00
Aayush Anand
6eb0ea7738 added fix for issue #235 2022-11-12 20:24:36 +05:30
Pranav
a8aa3cc999
Merge pull request #231 from BryanFlynt/master
No install when used as third party
2022-11-08 09:42:30 -06:00