Commit graph

229 commits

Author SHA1 Message Date
Miss Islington (bot)
6f3c2c8d04
[3.13] gh-126180: Remove getopt and optparse deprecation notices (GH-128191)
* Remove getopt and optparse deprecation notices
* Add new docs sections for command line app helper libraries
* Add guidance on choosing a CLI parsing library to the optparse docs
* Link to the new guidance from the argparse and getopt docs
* Reword intro in docs section for superseded stdlib modules
* Reframe the optparse->argparse guide as a migration guide
  rather than as an upgrade guide

---------
(cherry picked from commit 831b6de6d7)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-12-23 04:40:59 +00:00
Miss Islington (bot)
1b58c0f308
[3.13] GH-122679: Add register() to argparse docs (GH-126939) (GH-127149)
(cherry picked from commit fcfdb55465)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-11-22 16:12:05 +02:00
Serhiy Storchaka
6b0ef1fd6f
[3.13] gh-126071: Improve formatting of the argparse documentation (GH-126073) (GH-126173)
* Use appropriate roles for ArgumentParser, Action, etc.
* Remove superfluous repeated links.
* Explicitly document signatures and add index entries for some methods
  and classes.
* Make it more clear that some parameters are keyword-only.
* Fix some minor errors.
(cherry picked from commit 2ab377a47c)
2024-10-30 09:21:38 +00:00
Miss Islington (bot)
e4204e879e
[3.13] gh-84545: Clarify the 'extend' action documentation in argparse (GH-125870) (GH-125964)
(cherry picked from commit da8673da36)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-26 21:37:06 +03:00
Miss Islington (bot)
cc66dfc86c
[3.13] gh-89819: Add argument_default and conflict_handler to add_argument_group() docs (GH-125379) (GH-125538)
(cherry picked from commit c9826c11db)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-10-15 16:09:50 +00:00
Miss Islington (bot)
0542645354
[3.13] gh-85935: Explicitly document the case nargs=0 in argparse (GH-125302) (GH-125357)
(cherry picked from commit 07c2d15977)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-12 16:02:26 +03:00
Miss Islington (bot)
1fe27103e0
[3.13] gh-125296: Fix strange fragment identifier for name or flags in argparse docs (GH-125297) (#125299)
gh-125296: Fix strange fragment identifier for `name or flags` in argparse docs (GH-125297)
(cherry picked from commit c1913effee)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-10-11 06:35:49 +00:00
Miss Islington (bot)
319305c0bf
[3.13] Note argparse exit code in documentation (GH-119568) (GH-125274)
(cherry picked from commit 3b87fb74c9)

Co-authored-by: Justin Kunimune <justinkunimune@gmail.com>
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-10-10 21:18:17 +03:00
Savannah Ostrowski
5f2a5ac9dc
[3.13] GH-124478: Cleanup argparse documentation (GH-124877) (#125162)
(cherry picked from commit 37228bd16e)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2024-10-08 16:20:01 -07:00
Miss Islington (bot)
4a9a359f32
[3.13] gh-61181: Fix support of choices with string value in argparse (GH-124578) (GH-124755)
Substrings of the specified string no longer considered valid values.
(cherry picked from commit f1a2417b9e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-08 00:28:17 +03:00
Miss Islington (bot)
e5105ccbe1
[3.13] gh-65169: Clarify prog default in argparse (GH-31602) (#124430)
gh-65169: Clarify prog default in argparse (GH-31602)
(cherry picked from commit e69ff34e81)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2024-09-24 11:26:32 -07:00
Miss Islington (bot)
b4b182a84d
[3.13] GH-87358: Add clarification about nargs and default argparse behaviour (GH-124094) (#124440)
GH-87358: Add clarification about nargs and default argparse behaviour (GH-124094)
(cherry picked from commit 20ccda000b)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-09-24 11:08:02 -07:00
Miss Islington (bot)
a052faf58e
[3.13] GH-79714: Add mention of stderr for clarity to ArgumentParser.exit() (GH-123932) (#124331)
GH-79714: Add mention of stderr for clarity to ArgumentParser.exit() (GH-123932)
(cherry picked from commit 5f5c0b9c23)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-09-23 15:50:24 -07:00
Miss Islington (bot)
b11a77668c
[3.13] gh-83648: Use versionadded in 'deprecated' description (GH-121878)
(cherry picked from commit 4e35dd607b)

Authored-by: Zachary Ware <zach@python.org>
2024-07-16 21:43:40 +00:00
Miss Islington (bot)
c33bba6eb3
[3.13] docs: module page titles should not start with a link to themselves (GH-117099) (#118790)
docs: module page titles should not start with a link to themselves (GH-117099)
(cherry picked from commit bcb435ee8f)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-05-08 19:52:39 +00:00
0xflotus
cbe809dfa9
gh-83648: Add missing deprecated arg in argparse.rst (GH-115640) 2024-02-19 10:29:32 +02:00
Serhiy Storchaka
bb57ffdb38
gh-83648: Support deprecation of options, arguments and subcommands in argparse (GH-114086) 2024-02-06 00:41:34 +02:00
Erlend E. Aasland
1d7bddd961
Docs: align usage of versionadded/versionchanged with recommended practice (#114409)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2024-01-22 21:40:26 +00:00
Jelle Zijlstra
ab8f54668b
gh-103921: Rename "type" header in argparse docs (#104654)
This allows :keyword:`type` to link to docs for the new `type`
statement (being written in gh-104642) instead of to this header
in the argparse docs.
2023-05-19 06:50:34 -07:00
Hugo van Kemenade
79ae019164
gh-101100: Fix Sphinx warnings in argparse module (#103289)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-04-24 15:36:32 -06:00
Nikita Sobolev
f4d087964e
gh-103582: Remove last references to argparse.REMAINDER from docs (#103586) 2023-04-18 23:02:48 -06:00
Marcin Wieczorek
061325e0d2
Fix style in argparse.rst (#101733) 2023-03-07 23:25:28 -08:00
Patricio Paez
6aab56f3c2
gh-99735: Use required=True in argparse subparsers example (#100927) 2023-02-18 17:06:03 -08:00
alnoki
6e4a521c2a
Add missing preposition in argparse docs (#101548) 2023-02-05 15:15:07 +05:30
Guy Yagev
ad3c99e521
gh-92446: Improve argparse choices docs; revert bad change to lzma docs (#94627)
Based on the definition of the collections.abc classes, it is more accurate to use "sequence" instead of "container" when describing argparse choices.

A previous attempt at fixing this in #92450 was mistaken; this PR reverts that change.

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-26 00:22:53 -06:00
Stanley
286e3c76a9
gh-99087: Add missing newline for prompts in docs (GH-98993)
Add newline for prompts so copying to REPL does not cause errors.
2022-12-08 19:31:19 -08:00
ram vikram singh
f5fea22886
gh-99650 : Updated argparse docs (GH-99653) 2022-11-22 13:16:06 -08:00
Skip Montanaro
b27b57c6e4
argparse docs: normalize constant references (#98765) 2022-10-28 13:15:39 +01:00
Scott Main
810ae51787
gh-94787: [doc] Add to argparse doc an example of a mutually-exclusive group nested in an argument group (GH-94807) 2022-09-18 09:05:43 +01:00
Inada Naoki
9877f4c624
gh-85308: argparse: Use filesystem encoding for arguments file (GH-93277) 2022-06-23 12:09:57 +09:00
180909
f2d994da10
gh-92812: Align ArgumentParser.add_subparsers() docs with argument spec (#92814) 2022-05-18 23:08:23 +02:00
slateny
3e3e8976b8
bpo-9182: Add a section on specifying positional arguments (#31810) 2022-05-13 09:17:07 -05:00
thueringa
f67d71b431
Fix typo in argparse docs. (GH-92691)
# Fix typo in argparse docs.

> Sometimes, when dealing with **a** particularly long argument list**s**, [...]

Mixture between plural and singular forms is incorrect. Use singular consistently since typically only a single argument list is employed. Change to:

> Sometimes, when dealing with a particularly long argument list, [...]

No issue was opened, since this is a trivial change.

Automerge-Triggered-By: GH:rhettinger
2022-05-11 20:25:09 -07: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