Docs: Avoid the deprecated `.. cmdoption::` directive (#110292)

This commit is contained in:
Adam Turner 2023-10-03 18:38:12 +01:00 committed by GitHub
parent d67edcf0b3
commit 77e9aae383
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 243 additions and 243 deletions

View file

@ -59,7 +59,7 @@ all consecutive arguments will end up in :data:`sys.argv` -- note that the first
element, subscript zero (``sys.argv[0]``), is a string reflecting the program's
source.
.. cmdoption:: -c <command>
.. option:: -c <command>
Execute the Python code in *command*. *command* can be one or more
statements separated by newlines, with significant leading whitespace as in
@ -72,7 +72,7 @@ source.
.. audit-event:: cpython.run_command command cmdoption-c
.. cmdoption:: -m <module-name>
.. option:: -m <module-name>
Search :data:`sys.path` for the named module and execute its contents as
the :mod:`__main__` module.
@ -188,35 +188,35 @@ automatically enabled, if available on your platform (see
Generic options
~~~~~~~~~~~~~~~
.. cmdoption:: -?
-h
--help
.. option:: -?
-h
--help
Print a short description of all command line options and corresponding
environment variables and exit.
.. cmdoption:: --help-env
.. option:: --help-env
Print a short description of Python-specific environment variables
and exit.
.. versionadded:: 3.11
.. cmdoption:: --help-xoptions
.. option:: --help-xoptions
Print a description of implementation-specific :option:`-X` options
and exit.
.. versionadded:: 3.11
.. cmdoption:: --help-all
.. option:: --help-all
Print complete usage information and exit.
.. versionadded:: 3.11
.. cmdoption:: -V
--version
.. option:: -V
--version
Print the Python version number and exit. Example output could be:
@ -240,7 +240,7 @@ Generic options
Miscellaneous options
~~~~~~~~~~~~~~~~~~~~~
.. cmdoption:: -b
.. option:: -b
Issue a warning when comparing :class:`bytes` or :class:`bytearray` with
:class:`str` or :class:`bytes` with :class:`int`. Issue an error when the
@ -249,13 +249,13 @@ Miscellaneous options
.. versionchanged:: 3.5
Affects comparisons of :class:`bytes` with :class:`int`.
.. cmdoption:: -B
.. option:: -B
If given, Python won't try to write ``.pyc`` files on the
import of source modules. See also :envvar:`PYTHONDONTWRITEBYTECODE`.
.. cmdoption:: --check-hash-based-pycs default|always|never
.. option:: --check-hash-based-pycs default|always|never
Control the validation behavior of hash-based ``.pyc`` files. See
:ref:`pyc-invalidation`. When set to ``default``, checked and unchecked
@ -269,7 +269,7 @@ Miscellaneous options
option.
.. cmdoption:: -d
.. option:: -d
Turn on parser debugging output (for expert only).
See also the :envvar:`PYTHONDEBUG` environment variable.
@ -278,7 +278,7 @@ Miscellaneous options
it's ignored.
.. cmdoption:: -E
.. option:: -E
Ignore all :envvar:`PYTHON*` environment variables, e.g.
:envvar:`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set.
@ -286,7 +286,7 @@ Miscellaneous options
See also the :option:`-P` and :option:`-I` (isolated) options.
.. cmdoption:: -i
.. option:: -i
When a script is passed as first argument or the :option:`-c` option is used,
enter interactive mode after executing the script or the command, even when
@ -297,7 +297,7 @@ Miscellaneous options
raises an exception. See also :envvar:`PYTHONINSPECT`.
.. cmdoption:: -I
.. option:: -I
Run Python in isolated mode. This also implies :option:`-E`, :option:`-P`
and :option:`-s` options.
@ -310,7 +310,7 @@ Miscellaneous options
.. versionadded:: 3.4
.. cmdoption:: -O
.. option:: -O
Remove assert statements and any code conditional on the value of
:const:`__debug__`. Augment the filename for compiled
@ -321,7 +321,7 @@ Miscellaneous options
Modify ``.pyc`` filenames according to :pep:`488`.
.. cmdoption:: -OO
.. option:: -OO
Do :option:`-O` and also discard docstrings. Augment the filename
for compiled (:term:`bytecode`) files by adding ``.opt-2`` before the
@ -331,7 +331,7 @@ Miscellaneous options
Modify ``.pyc`` filenames according to :pep:`488`.
.. cmdoption:: -P
.. option:: -P
Don't prepend a potentially unsafe path to :data:`sys.path`:
@ -348,14 +348,14 @@ Miscellaneous options
.. versionadded:: 3.11
.. cmdoption:: -q
.. option:: -q
Don't display the copyright and version messages even in interactive mode.
.. versionadded:: 3.2
.. cmdoption:: -R
.. option:: -R
Turn on hash randomization. This option only has an effect if the
:envvar:`PYTHONHASHSEED` environment variable is set to ``0``, since hash
@ -381,7 +381,7 @@ Miscellaneous options
.. versionadded:: 3.2.3
.. cmdoption:: -s
.. option:: -s
Don't add the :data:`user site-packages directory <site.USER_SITE>` to
:data:`sys.path`.
@ -391,7 +391,7 @@ Miscellaneous options
:pep:`370` -- Per user site-packages directory
.. cmdoption:: -S
.. option:: -S
Disable the import of the module :mod:`site` and the site-dependent
manipulations of :data:`sys.path` that it entails. Also disable these
@ -399,7 +399,7 @@ Miscellaneous options
:func:`site.main` if you want them to be triggered).
.. cmdoption:: -u
.. option:: -u
Force the stdout and stderr streams to be unbuffered. This option has no
effect on the stdin stream.
@ -410,7 +410,7 @@ Miscellaneous options
The text layer of the stdout and stderr streams now is unbuffered.
.. cmdoption:: -v
.. option:: -v
Print a message each time a module is initialized, showing the place
(filename or built-in module) from which it is loaded. When given twice
@ -425,7 +425,7 @@ Miscellaneous options
.. _using-on-warnings:
.. cmdoption:: -W arg
.. option:: -W arg
Warning control. Python's warning machinery by default prints warning
messages to :data:`sys.stderr`.
@ -484,13 +484,13 @@ Miscellaneous options
details.
.. cmdoption:: -x
.. option:: -x
Skip the first line of the source, allowing use of non-Unix forms of
``#!cmd``. This is intended for a DOS specific hack only.
.. cmdoption:: -X
.. option:: -X
Reserved for various implementation-specific options. CPython currently
defines the following possible values:
@ -597,7 +597,7 @@ Miscellaneous options
Options you shouldn't use
~~~~~~~~~~~~~~~~~~~~~~~~~
.. cmdoption:: -J
.. option:: -J
Reserved for use by Jython_.