Erlend E. Aasland
eb94a0426f
[3.11] Docs: align usage of versionadded/versionchanged with recommended practice ( #114409 ) ( #114473 )
...
(cherry picked from commit 1d7bddd961
)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2024-01-23 10:39:25 +01:00
Hugo van Kemenade
9f4364355e
[3.11] gh-101100: Fix Sphinx warnings in `argparse` module ( #103289 ) ( #103803 )
...
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-04-24 22:15:04 +00:00
Miss Islington (bot)
5a81a24c8b
gh-103582: Remove last references to `argparse.REMAINDER` from docs (GH-103586)
...
(cherry picked from commit f4d087964e
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-04-18 22:14:53 -07:00
Miss Islington (bot)
8bf8e3d9a0
Fix style in argparse.rst (GH-101733)
...
(cherry picked from commit 061325e0d2
)
Co-authored-by: Marcin Wieczorek <marcin@marcin.co>
2023-03-07 23:33:52 -08:00
Miss Islington (bot)
4969903f7e
gh-99735: Use required=True in argparse subparsers example (GH-100927)
...
(cherry picked from commit 6aab56f3c2
)
Co-authored-by: Patricio Paez <nospam@pp.com.mx>
2023-02-19 11:11:40 -08:00
Shantanu
2cb4b13af6
[3.11] gh-92446: Improve argparse choices docs (GH-94627) ( #100528 )
...
Based on the definition of the collections.abc classes, it is more accurate to use "sequence" instead of "container" when describing argparse choices.
(cherry picked from commit ad3c99e521
)
Co-authored-by: Guy Yagev <yourlefthandman8@gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-26 01:09:06 -06:00
Miss Islington (bot)
b4ae5b76ed
[3.11] gh-99650 : Updated argparse docs (GH-99653) (GH-99705)
2022-11-22 14:17:20 -08:00
Miss Islington (bot)
2d4b6e00f0
`argparse` docs: normalize constant references (GH-98765)
...
(cherry picked from commit b27b57c6e4
)
Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
2022-10-28 05:25:58 -07:00
Miss Islington (bot)
849963598f
gh-92812: Align ArgumentParser.add_subparsers() docs with argument spec (GH-92814)
...
(cherry picked from commit f2d994da10
)
Co-authored-by: 180909 <734461790@qq.com>
2022-05-18 14:25:25 -07:00
Miss Islington (bot)
60c4bca013
Fix typo in argparse docs. (GH-92691) ( #92709 )
2022-05-13 09:03:03 -05:00
Hai Shi
301351c6a2
update argparse's doc of append action. ( #92344 )
2022-05-05 22:32:35 -05:00
Antonio Andrade
238aa6253b
Improving readability of argparse.rst (GH-91751)
...
Fixed few typos and enhanced few paragraphs for your review and consideration.
Trivial contribution towards continuous improvement, so no issue was raised.
Automerge-Triggered-By: GH:rhettinger
2022-04-30 15:20:10 -07:00
Raymond Hettinger
25e35742ce
Minor improvements to grammar and markup. (GH-91762)
2022-04-20 16:02:47 -05:00
Raymond Hettinger
26f2e688b8
Clean-up the argparse docs quick links table (GH-91726)
2022-04-20 01:21:54 -05:00
Susan Su
8e76d7e1a9
bpo-21150: Add quick link/summary table to the top of argparse documentation (GH-12005)
...
No work has been done to move this forward. On the theory that perfect is the enemy of good, I'm going to push it and we can make minor edits as needed afterwards.
2022-04-17 23:46:18 -05:00
Jade Lovelace
8e75c6b49b
argparse docs: prog default is the basename of argv[0] (GH-30298)
2022-01-02 12:16:25 -08:00
Irit Katriel
30322c497e
bpo-22047: [argparse] deprecate nested argument groups and mutually exclusive groups (GH-30098)
2021-12-16 15:31:08 +00:00
Louis Sautier
db0133f98d
[doc] fix minor typo for argparse (GH-28451)
...
"A JSONDecodeError" instead of "An JSONDecodeError".
2021-09-28 14:00:51 +03:00
Jack DeVries
0ad173249d
bpo-37880: for argparse add_argument with action='store_const', const now defaults to None. (GH-26707)
2021-07-31 17:27:55 +01:00
David Sanders
da2e673c53
bpo-42194: Add "New in version: 3.9" to argparse.BooleanOptionalAction (GH-23026)
2021-07-12 17:19:54 +02:00
Andre Delfino
52cd6d5e1b
Use the zero argument form of super() in examples for Python3 docs. (GH-22314)
2021-04-26 15:13:54 -07:00
Taneli Hukkinen
7be870f945
Fix documentation typos of argparse exit_on_error (GH-22706)
2021-04-25 21:04:26 -07:00
Raymond Hettinger
41b223d29c
bpo-9694: Fix misleading phrase "optional arguments" (GH-23858)
2020-12-23 09:40:56 -08:00
Raymond Hettinger
6afb730e2a
bpo-29030: Document interaction between *choices* and *metavar*. (GH-23884)
2020-12-22 09:24:26 -08:00
Raymond Hettinger
b0398a4b7f
bpo-42572: Improve argparse docs for the type parameter. (GH-23849)
2020-12-20 10:14:54 -08:00
Raymond Hettinger
752cdf21eb
bpo-38843: Document behavior of default when the attribute is already set (GH-23653)
2020-12-06 18:29:08 -08:00
Raymond Hettinger
7f82f22eba
bpo-42501: Revise the usage note for Enums with the choices (GH-23563)
2020-11-30 09:55:13 -08:00
SarahPythonista
8784d3300e
Fix error in argparse documentation example (GH-17399)
...
Automerge-Triggered-By: @rhettinger
2020-08-28 11:47:58 -07:00
Vincent Férotin
344c2a75c1
bpo-41024: doc: Explicitly mention use of 'enum.Enum' as a valid container for '… (GH-20964)
...
…choices' argument of 'argparse.ArgumentParser.add_argument'.
Here's a short first proposal of doc. enhancement addressing [bpo-41024]().
Automerge-Triggered-By: @csabella
2020-06-20 05:55:05 -07:00
Albert
59f5022b5d
bpo-17050: Remove documentation on argparse.REMAINDER (GH-18661)
...
Closes [Issue 17050]() by removing argparse.REMAINDER from the documentation, as discussed on the issue.
Automerge-Triggered-By: @rhettinger
2020-05-24 11:57:40 -07:00
Raymond Hettinger
04c79d6088
bpo-38678: Improve argparse example in tutorial (GH-17207)
2019-11-17 22:06:19 -08:00
Brandt Bucher
a0ed99bca8
bpo-38438: Simplify argparse "star nargs" usage. (GH-17106)
2019-11-11 12:47:48 -08:00
Batuhan Taşkaya
74142078b3
bpo-38531: document extend action's added version (GH-16865)
2019-10-20 13:13:54 -07:00
Adam J. Stewart
9e71917e02
bpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588)
...
The `required` argument to `argparse.add_subparsers` was added in #3027 . This PR specifies the earliest version of Python where it is available.
https://bugs.python.org/issue26510
Automerge-Triggered-By: @merwok
2019-10-06 19:08:48 -07:00
Rémi Lapeyre
6a517c6749
bpo-8538: Add support for boolean actions to argparse (GH-11478)
...
Co-Authored-By: remilapeyre <remi.lapeyre@henki.fr>
2019-09-13 11:17:43 +01:00
Hai Shi
b1a2abdb06
bpo-37908: Add an example of ArgumentParser.exit() (GH-15455)
...
Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
2019-09-12 16:34:24 +01:00
Hai Shi
f545638b57
bpo-9938: Add optional keyword argument exit_on_error to argparse.ArgumentParser (GH-15362)
...
Co-Authored-by: Xuanji Li <xuanji@gmail.com>
https://bugs.python.org/issue9938
Automerge-Triggered-By: @matrixise
2019-09-12 03:56:05 -07:00
Raymond Hettinger
84125fed2a
bpo-16468: Clarify which objects can be passed to "choices" in argparse (GH-15566)
2019-08-29 00:58:08 -07:00
Zac Hatfield-Dodds
dffca9e925
bpo-26967: fix flag grouping with allow_abbrev=False (GH-14316)
...
The `allow_abbrev` option for ArgumentParser is documented and intended to disable support for unique prefixes of --options, which may sometimes be ambiguous due to deferred parsing.
However, the initial implementation also broke parsing of grouped short flags, such as `-ab` meaning `-a -b` (or `-a=b`). Checking the argument for a leading `--` before rejecting it fixes this.
This was prompted by pytest-dev/pytest#5469 , so a backport to at least 3.8 would be great 😄
And this is my first PR to CPython, so please let me know if I've missed anything!
https://bugs.python.org/issue26967
2019-07-13 22:35:58 -07:00
Batuhan Taşkaya
aa32a7e111
bpo-23378: Add an extend action to argparse (GH-13305)
...
Add an extend action to argparse
https://bugs.python.org/issue23378
2019-05-21 10:47:42 -07:00
Serhiy Storchaka
913876d824
bpo-35054: Add yet more index entries for symbols. (GH-10121)
2018-10-28 13:41:26 +02:00
Anthony Sottile
cc18258daf
Fix doc for `add_subparsers` arguments (GH-8884)
...
There was a missing comma.
2018-08-23 20:08:54 -07:00
Ned Deily
8ebf5ceb0f
bpo-33109: argparse subparsers are once again not required by default (GH-6919)
...
bpo-26510 in 3.7.0a2 changed the behavior of argparse to make
subparsers required by default, returning to the behavior of 2.7
and 3.2. The behavior was changed in 3.3 to be no longer required.
While it might make more sense to have the default to required,
compatibility with 3.3 through 3.6 is probably less disruptive
than trying to reintroduce compatibility with 2.7 at this point.
This change restores the 3.6 behavior.
2018-05-23 21:55:15 -04:00
suic86
04e8293465
Fix error messages in argparse examples (GH-6435)
...
The examples in argparse documentation use `error: too few arguments`
error message which was removed in this commit f97c59a
in 2011.
2018-04-11 13:45:04 -05:00
Julien Palard
78553138be
Fix typos '.::' should typically just be '::'. (GH-6165)
2018-03-28 23:14:15 +02:00
Anthony Sottile
aaf6fc0982
bpo-26510: make argparse subparsers required by default ( #3027 )
...
This fixes a regression from Python 2. To get optional subparsers,
use the new parameter ``add_subparsers(required=False)``.
Patch by Anthony Sottile.
2017-09-20 17:35:27 -04:00
Elena Oat
397c467c49
bpo-31330: Clarify that RawTextHelpFormatter collapses repeated newlines. ( #3272 )
...
Also provide a solution if the user wants to keep multiple blank lines.
2017-09-07 16:06:45 -04:00
R. David Murray
0f6b9d2306
bpo-14191 Add parse_intermixed_args. ( #3319 )
...
This adds support for parsing a command line where options and positionals are intermixed as is common in many unix commands. This is paul.j3's patch with a few tweaks.
2017-09-06 20:25:40 -04:00
R. David Murray
0c7983e4ad
Clarify nature of parse_args 'args' argument. ( #3292 )
...
Patch by Paul.j3. Includes an unrelated but useful addition to the
optparse porting section.
2017-09-04 16:17:26 -04:00
Martin Panter
536d70ed33
Fix grammar, typos and markup in documentation and code comments
...
* Indent versionchanged at method level, not class level
* Mark up ``--help`` to avoid generating an en dash
* Use forward slash in Unix command line with a dollar sign ($) prompt
2017-01-14 08:23:08 +00:00