Commit Graph

733 Commits

Author SHA1 Message Date
Pranav
d924b84eba
Merge pull request #395 from ndevenish/float
store_into: Accept float (by accepting generic floating point)
2025-01-26 18:27:21 -05:00
Nicholas Devenish
1f2187b0e1 store_into: Accept float (by accepting generic floating point) 2025-01-26 21:11:42 +00:00
root
3eda91b2e1 Bumped version to 3.2 2025-01-25 15:27:24 +00:00
Pranav
22b54b8e62
Merge pull request #356 from elpaso/multiple-actions
FEATURE: multiple actions
2025-01-20 13:16:51 -05:00
Pranav
e39aa895ab
Merge pull request #386 from DapengFeng/master
support `store_into` std::filesystem::path
2025-01-20 13:14:56 -05:00
Pranav
01f4fa4537
Merge pull request #388 from geon6/bugfix/385_store_into
fix bug 385
2025-01-20 13:14:37 -05:00
Pranav
3a43e75367
Merge pull request #393 from rouault/single_arg_larger_than_max_width
usage(): do not emit blank line when a single argument exceeds set_usage_max_line_width()
2025-01-20 13:13:29 -05:00
Even Rouault
9b4c63a2d8
usage(): do not emit blank line when a single argument exceeds set_usage_max_line_width() 2025-01-20 15:55:01 +01:00
geon6
8bacffdf90 fix bug 385 2024-11-27 16:52:29 +08:00
DapengFeng
ba077697d6 support store_into std::filesystem::path 2024-11-22 16:51:02 +08:00
Pranav
cbd9fd8ed6
Merge pull request #382 from rouault/usage_subparser
subparser: use full parser path instead of just parser name in usage() message
2024-11-19 19:22:14 -05:00
Even Rouault
097bac1854
subparser: use full parser path instead of just parser name in usage() message 2024-11-08 20:49:15 +01:00
Even Rouault
b5cfa7ea46
tidy-analysis-stage-01.yml: update to actions/upload-artifact@v4 since v2 is no longer working 2024-11-08 20:48:15 +01:00
Pranav
84c02050ea
Merge pull request #377 from Eng-MohamedHussien/fix/370_range_of_choices
Fix range of choices bug
2024-09-20 09:03:02 -04:00
Pranav
e709046924
Merge pull request #380 from orenc17/fix-store_into-overload
Dont force store_into to override default/explicit values if already set
2024-09-20 09:02:13 -04:00
Oren Cohen
d40d2fcecf Dont force store_into to override default/explicit values if already set 2024-09-19 16:53:54 +03:00
Muhammad Hussein
43072b8e8c Fix range of choices bug
- Support range of choices.
- Add testcases for range of choices scenario.

fix #370
2024-09-03 18:08:50 +03:00
Pranav
fd13c28591
Merge pull request #376 from nick20201/master
Updated the min and max to deal with a macro in minwindef.h
2024-09-02 12:09:52 -04:00
Nick T
df58f9d140
Updated the min and max to deal with a macro in minwindef.h 2024-08-15 15:47:23 +12:00
Pranav
8a7fa18998
Merge pull request #373 from temikfart/edit-readme-toc
Add missed ToC link to README.md
2024-07-31 06:29:48 -04:00
Artyom Fartygin
e927d08698 Add missed ToC link to README.md
Add missed link to 'Getting Argument and Subparser Instances' paragraph.
2024-07-31 00:40:55 +03:00
Pranav Srinivas Kumar
1b27c6f3da Updated package configuration version check to use SameMajorVersion instead of ExactVersion, closes #371 2024-07-19 14:20:54 -04:00
Pranav Srinivas Kumar
68fd0277ee Bumped to v3.1 2024-07-17 19:53:38 -04:00
Pranav
a2b4d27989
Merge pull request #364 from zhao-shihan/master
Allow to install when argparse is a subproject
2024-06-15 13:07:20 -04:00
zhaoshihan
16d0e56005 Allow to install when argparse is a subproject 2024-06-15 21:30:03 +08:00
Pranav
e462ab980c
Merge pull request #361 from RichardBrown384/rbrown/correct-readme
Correct Parent Parser errors in README.md
2024-05-29 20:32:31 -04:00
RichardBrown384
0c44bc349f
Correct Parent Parser errors in README.md
* Rename parent_parser -> surface_parser
* The second constructor argument is a string.
2024-05-29 11:05:15 +02:00
Pranav
9893754f67
Merge pull request #360 from rouault/too_few_arguments
Add argument name after 'Too few arguments' error
2024-05-27 15:57:25 -04:00
Even Rouault
84b7b46ce5
Add argument name after 'Too few arguments' error
If a non-positional argument doesn't get the number of required values,
a generic "Too few arguments" error is generated, without its name, when
it is not the last argument (but if it is the last argument, we get its
name)
2024-05-27 19:21:29 +02:00
Pranav
eab1d75e49
Merge pull request #359 from ericonr/string-warning
parse_args(): work around GCC 12 warning bug.
2024-05-20 14:51:24 -04:00
Érico Nogueira
df43e47c00 parse_args(): work around GCC 12 warning bug.
This bug [1] causes GCC to emit a wrong warning when adding a short
string literal to a std::string. Wrapping the literal in a std::string
doesn't have a large impact and avoids the warning.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329
2024-05-20 14:50:02 -03:00
Pranav
f0759fd982
Merge pull request #357 from stripe2933/patch-1
Module improvement.
2024-05-11 10:46:23 -04:00
LEE KYOUNGHEON
df48de9bc8
Suppress false-positive warning.
export extern "C++" style is valid in Clang (https://clang.llvm.org/docs/StandardCPlusPlusModules.html#export-extern-c-style), but warning emitted. This commit disables it.
2024-05-11 19:09:09 +09:00
Alessandro Pasotti
8dead89026 FEATURE: multiple actions
Also fixes the incompatibility between store_into and scan and action:
when the three methods above were called, being all based on the
(unique) action, the last one would overwrite the previous ones.

This issue was making the parser strictly dependant on the order
of the scan/store_into/action calls making them mutually exclusive.
2024-05-09 09:53:34 +02:00
Pranav
eba16b3773
Merge pull request #353 from rouault/do_from_chars_coverity_warning
do_from_chars(): initialize variable to fix Coverity Scan warning
2024-05-05 19:12:04 -04:00
Even Rouault
5228c57938
do_from_chars(): initialize variable to fix Coverity Scan warning
The argparse.hpp copy inside GDAL has caused Coverity Scan to emit a
(false-positive) warning about x not being initialized.

```
________________________________________________________________________________________________________
*** CID 1544814:  Uninitialized variables  (UNINIT)
/gdal/apps/argparse/argparse.hpp: 257 in gdal_argparse::details::do_from_chars<unsigned char, (int)10>(std::basic_string_view<char, std::char_traits<char>>)()
251       if (ec == std::errc::invalid_argument) {
252         throw std::invalid_argument{"pattern '" + std::string(s) + "' not found"};
253       }
254       if (ec == std::errc::result_out_of_range) {
255         throw std::range_error{"'" + std::string(s) + "' not representable"};
256       }
>>>     CID 1544814:  Uninitialized variables  (UNINIT)
>>>     Using uninitialized value "x".
```

Let's initialize it to 0 to make the analyzer happy
2024-05-05 21:35:58 +02:00
Pranav
ce7db9962a
Merge pull request #352 from FantasqueX/bazel-1
add Bazel support
2024-05-05 10:18:58 -04:00
Letu Ren
cc43cb9a63 add Bazel support 2024-05-05 15:37:45 +08:00
Pranav
805e2356a9
Merge pull request #348 from elpaso/store_into-set-of-string-int
Add Argument::store_into(std::set<int||string> &var) method
2024-04-30 20:38:21 -04:00
Alessandro Pasotti
b85a0a414d Add Argument::store_into(std::set<int||string> &var) method 2024-04-30 17:30:48 +02:00
Pranav
ac4c2c2d96
Merge pull request #346 from abellgithub/store_ints
Store ints
2024-04-18 20:45:29 -04:00
Andrew Bell
7cb70ed6f3 Don't store -1 into unsigned value. 2024-04-18 18:11:07 -04:00
Andrew Bell
29f1d12333 Add cstdint header. 2024-04-18 08:24:57 -04:00
Andrew Bell
e54e459286 Pass type along to parse_number(). 2024-04-17 13:42:37 -04:00
Andrew Bell
d141b8d2a1 Add support for general integer types in store_into. 2024-04-17 13:35:51 -04:00
Pranav
9550b0a88c
Merge pull request #344 from rouault/At_least_one_followed_by_exactly_one
Fix parsing of a program that accepts a positional argument with 1:* cardinality followed by another positional argument with 1:1
2024-04-02 19:46:38 -04:00
Pranav
1c4820579c
Merge pull request #343 from rouault/store_into_vector_int
Add Argument::store_into(std::vector<int> &var) method
2024-04-02 19:45:31 -04:00
Even Rouault
2c245a2c3b
Fix parsing of a program that accepts a positional argument with 1:* cardinality followed by another positional argument with 1:1 2024-04-02 23:35:43 +02:00
Even Rouault
29367256d3
Add Argument::store_into(std::vector<int> &var) method 2024-04-02 23:22:53 +02:00
Pranav
a1c41c5537
Merge pull request #336 from rouault/hidden_argument
Add a Argument::hidden() method to prevent an argument from appearing in usage or help
2024-03-16 10:51:35 -04:00