Skip to content

Commit 9350a5f

Browse files
committed
gh-126031: Format add_argument parameter headings as code
1 parent 523caa5 commit 9350a5f

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

‎Doc/library/argparse.rst‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,8 @@ The following sections describe how each of these are used.
701701

702702
.. _`name or flags`:
703703

704-
name or flags
705-
^^^^^^^^^^^^^
704+
``name`` or ``flags``
705+
^^^^^^^^^^^^^^^^^^^^^
706706

707707
The :meth:`~ArgumentParser.add_argument` method must know whether an optional
708708
argument, like ``-f`` or ``--foo``, or a positional argument, like a list of
@@ -755,8 +755,8 @@ the upper-cased name. For example::
755755

756756
.. _action:
757757

758-
action
759-
^^^^^^
758+
``action``
759+
^^^^^^^^^^
760760

761761
:class:`ArgumentParser` objects associate command-line arguments with actions. These
762762
actions can do just about anything with the command-line arguments associated with
@@ -897,8 +897,8 @@ For more details, see :class:`Action`.
897897

898898
.. _nargs:
899899

900-
nargs
901-
^^^^^
900+
``nargs``
901+
^^^^^^^^^
902902

903903
:class:`ArgumentParser` objects usually associate a single command-line argument with a
904904
single action to be taken. The ``nargs`` keyword argument associates a
@@ -986,8 +986,8 @@ Actions that do not consume command-line arguments (e.g.
986986

987987
.. _const:
988988

989-
const
990-
^^^^^
989+
``const``
990+
^^^^^^^^^
991991

992992
The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to hold
993993
constant values that are not read from the command line but are required for
@@ -1014,8 +1014,8 @@ the various :class:`ArgumentParser` actions. The two most common uses of it are
10141014

10151015
.. _default:
10161016

1017-
default
1018-
^^^^^^^
1017+
``default``
1018+
^^^^^^^^^^^
10191019

10201020
All optional arguments and some positional arguments may be omitted at the
10211021
command line. The ``default`` keyword argument of
@@ -1084,8 +1084,8 @@ command-line argument was not present::
10841084

10851085
.. _argparse-type:
10861086

1087-
type
1088-
^^^^
1087+
``type``
1088+
^^^^^^^^
10891089

10901090
By default, the parser reads command-line arguments in as simple
10911091
strings. However, quite often the command-line string should instead be
@@ -1163,8 +1163,8 @@ using the choices_ keyword instead.
11631163

11641164
.. _choices:
11651165

1166-
choices
1167-
^^^^^^^
1166+
``choices``
1167+
^^^^^^^^^^^
11681168

11691169
Some command-line arguments should be selected from a restricted set of values.
11701170
These can be handled by passing a sequence object as the *choices* keyword
@@ -1204,8 +1204,8 @@ many choices), just specify an explicit metavar_.
12041204

12051205
.. _required:
12061206

1207-
required
1208-
^^^^^^^^
1207+
``required``
1208+
^^^^^^^^^^^^
12091209

12101210
In general, the :mod:`!argparse` module assumes that flags like ``-f`` and ``--bar``
12111211
indicate *optional* arguments, which can always be omitted at the command line.
@@ -1232,8 +1232,8 @@ present at the command line.
12321232

12331233
.. _help:
12341234

1235-
help
1236-
^^^^
1235+
``help``
1236+
^^^^^^^^
12371237

12381238
The ``help`` value is a string containing a brief description of the argument.
12391239
When a user requests help (usually by using ``-h`` or ``--help`` at the
@@ -1274,8 +1274,8 @@ setting the ``help`` value to ``argparse.SUPPRESS``::
12741274

12751275
.. _metavar:
12761276

1277-
metavar
1278-
^^^^^^^
1277+
``metavar``
1278+
^^^^^^^^^^^
12791279

12801280
When :class:`ArgumentParser` generates help messages, it needs some way to refer
12811281
to each expected argument. By default, :class:`!ArgumentParser` objects use the dest_
@@ -1340,8 +1340,8 @@ arguments::
13401340

13411341
.. _dest:
13421342

1343-
dest
1344-
^^^^
1343+
``dest``
1344+
^^^^^^^^
13451345

13461346
Most :class:`ArgumentParser` actions add some value as an attribute of the
13471347
object returned by :meth:`~ArgumentParser.parse_args`. The name of this
@@ -1395,8 +1395,8 @@ strings* rather than ``dest`` names, see conflict_handler_.
13951395

13961396
.. _deprecated:
13971397

1398-
deprecated
1399-
^^^^^^^^^^
1398+
``deprecated``
1399+
^^^^^^^^^^^^^^
14001400

14011401
During a project's lifetime, some arguments may need to be removed from the
14021402
command line. Before removing them, you should inform

0 commit comments

Comments
 (0)