]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-89819: Add argument_default and conflict_handler to add_argument_group...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 15 Oct 2024 16:09:50 +0000 (18:09 +0200)
committerGitHub <noreply@github.com>
Tue, 15 Oct 2024 16:09:50 +0000 (16:09 +0000)
(cherry picked from commit c9826c11db25e81b1a90c837f84074879f1b1126)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
Doc/library/argparse.rst

index 4e66611ab172d1317a1e6458c6f6dd62c1a3c577..607364791bc8c1a330f04d3db146a317647ba7f4 100644 (file)
@@ -1785,7 +1785,8 @@ FileType objects
 Argument groups
 ^^^^^^^^^^^^^^^
 
-.. method:: ArgumentParser.add_argument_group(title=None, description=None)
+.. method:: ArgumentParser.add_argument_group(title=None, description=None, *, \
+                                              [argument_default], [conflict_handler])
 
    By default, :class:`ArgumentParser` groups command-line arguments into
    "positional arguments" and "options" when displaying help
@@ -1830,6 +1831,11 @@ Argument groups
 
        --bar BAR  bar help
 
+   The optional, keyword-only parameters argument_default_ and conflict_handler_
+   allow for finer-grained control of the behavior of the argument group. These
+   parameters have the same meaning as in the :class:`ArgumentParser` constructor,
+   but apply specifically to the argument group rather than the entire parser.
+
    Note that any arguments not in your user-defined groups will end up back
    in the usual "positional arguments" and "optional arguments" sections.