GH-130645: Default to color help in argparse (GH-136809)
(cherry picked from commit acbe896cb1)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Ćukasz Langa <lukasz@langa.pl>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
gh-54732: Make argparse error caused by empty rows in option files explicit (GH-136795)
(cherry picked from commit 8ffc3ef01e)
Co-authored-by: jdunter <2ve@mailbox.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-136032: Fix `argparse.BooleanOptionalAction` doc (GH-136133)
(cherry picked from commit 1953713d0d)
Co-authored-by: W. H. Wang <mattwang44@gmail.com>
Docs: Use `arguments` to replace `args` in `argparse.rst` (GH-135510)
(cherry picked from commit caad163b69)
Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
* 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
---------
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
The usage parameter of argparse.ArgumentParser no longer
affects the default value of the prog parameter in subparsers.
Previously the full custom usage of the main parser was used as
the prog prefix in subparsers.
* 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.
Also improve the documentation. Specify how dest and metavar are derived
from add_argument() positional arguments.
Co-authored-by: Simon Law <sfllaw@sfllaw.ca>
It can now have one of three forms:
* basename(argv0) -- for simple scripts
* python arv0 -- for directories, ZIP files, etc
* python -m module -- for imported modules
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
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>