Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 00ccacc

Browse files
committed
Issue #26638: Fix links to some CLI options and section headings
* Disable inappropriate links to Python interpreter options * Correct link to CLI section in zipapp * Make CLI section label in timeit less ambiguous
1 parent b4912b8 commit 00ccacc

11 files changed

Lines changed: 30 additions & 30 deletions

File tree

Doc/distutils/apiref.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,12 @@ This module provides the following functions.
319319

320320
.. function:: gen_preprocess_options(macros, include_dirs)
321321

322-
Generate C pre-processor options (:option:`-D`, :option:`-U`, :option:`-I`) as
322+
Generate C pre-processor options (:option:`-D`, :option:`!-U`, :option:`!-I`) as
323323
used by at least two types of compilers: the typical Unix compiler and Visual
324324
C++. *macros* is the usual thing, a list of 1- or 2-tuples, where ``(name,)``
325-
means undefine (:option:`-U`) macro *name*, and ``(name, value)`` means define
325+
means undefine (:option:`!-U`) macro *name*, and ``(name, value)`` means define
326326
(:option:`-D`) macro *name* to *value*. *include_dirs* is just a list of
327-
directory names to be added to the header file search path (:option:`-I`).
327+
directory names to be added to the header file search path (:option:`!-I`).
328328
Returns a list of command-line options suitable for either Unix compilers or
329329
Visual C++.
330330

@@ -799,7 +799,7 @@ This module provides the :class:`UnixCCompiler` class, a subclass of
799799

800800
* library search directories specified with :option:`-Ldir`
801801

802-
* compile handled by :program:`cc` (or similar) executable with :option:`-c`
802+
* compile handled by :program:`cc` (or similar) executable with :option:`!-c`
803803
option: compiles :file:`.c` to :file:`.o`
804804

805805
* link static library handled by :program:`ar` command (possibly with

Doc/distutils/configfile.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ option values can be split across multiple lines simply by indenting the
5151
continuation lines.
5252

5353
You can find out the list of options supported by a particular command with the
54-
universal :option:`--help` option, e.g. ::
54+
universal :option:`!--help` option, e.g. ::
5555

5656
> python setup.py --help build_ext
5757
[...]

Doc/install/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -865,12 +865,12 @@ config file will apply. (Or if other commands that derive values from it are
865865
run, they will use the values in the config file.)
866866

867867
You can find out the complete list of options for any command using the
868-
:option:`--help` option, e.g.::
868+
:option:`!--help` option, e.g.::
869869

870870
python setup.py build --help
871871

872872
and you can find out the complete list of global options by using
873-
:option:`--help` without a command::
873+
:option:`!--help` without a command::
874874

875875
python setup.py --help
876876

@@ -927,7 +927,7 @@ Let's examine each of the fields in turn.
927927
to be in Objective C.
928928

929929
* *cpparg* is an argument for the C preprocessor, and is anything starting with
930-
:option:`-I`, :option:`-D`, :option:`-U` or :option:`-C`.
930+
:option:`!-I`, :option:`-D`, :option:`!-U` or :option:`-C`.
931931

932932
* *library* is anything ending in :file:`.a` or beginning with :option:`-l` or
933933
:option:`-L`.

Doc/library/2to3.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Comments and exact indentation are preserved throughout the translation process.
5656

5757
By default, 2to3 runs a set of :ref:`predefined fixers <2to3-fixers>`. The
5858
:option:`-l` flag lists all available fixers. An explicit set of fixers to run
59-
can be given with :option:`-f`. Likewise the :option:`-x` explicitly disables a
59+
can be given with :option:`-f`. Likewise the :option:`!-x` explicitly disables a
6060
fixer. The following example runs only the ``imports`` and ``has_key`` fixers::
6161

6262
$ 2to3 -f imports -f has_key example.py
@@ -78,12 +78,12 @@ but 2to3 cannot fix automatically. In this case, 2to3 will print a warning
7878
beneath the diff for a file. You should address the warning in order to have
7979
compliant 3.x code.
8080

81-
2to3 can also refactor doctests. To enable this mode, use the :option:`-d`
81+
2to3 can also refactor doctests. To enable this mode, use the :option:`!-d`
8282
flag. Note that *only* doctests will be refactored. This also doesn't require
8383
the module to be valid Python. For example, doctest like examples in a reST
8484
document could also be refactored with this option.
8585

86-
The :option:`-v` option enables output of more information on the translation
86+
The :option:`!-v` option enables output of more information on the translation
8787
process.
8888

8989
Since some print statements can be parsed as function calls or statements, 2to3
@@ -102,14 +102,14 @@ when not overwriting the input files.
102102
.. versionadded:: 3.2.3
103103
The :option:`-o` option was added.
104104

105-
The :option:`-W` or :option:`--write-unchanged-files` flag tells 2to3 to always
105+
The :option:`!-W` or :option:`--write-unchanged-files` flag tells 2to3 to always
106106
write output files even if no changes were required to the file. This is most
107107
useful with :option:`-o` so that an entire Python source tree is copied with
108108
translation from one directory to another.
109109
This option implies the :option:`-w` flag as it would not make sense otherwise.
110110

111111
.. versionadded:: 3.2.3
112-
The :option:`-W` flag was added.
112+
The :option:`!-W` flag was added.
113113

114114
The :option:`--add-suffix` option specifies a string to append to all output
115115
filenames. The :option:`-n` flag is required when specifying this as backups

Doc/library/timeit.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
--------------
1515

1616
This module provides a simple way to time small bits of Python code. It has both
17-
a :ref:`command-line-interface` as well as a :ref:`callable <python-interface>`
17+
a :ref:`timeit-command-line-interface` as well as a :ref:`callable <python-interface>`
1818
one. It avoids a number of common traps for measuring execution times.
1919
See also Tim Peters' introduction to the "Algorithms" chapter in the *Python
2020
Cookbook*, published by O'Reilly.
@@ -23,7 +23,7 @@ Cookbook*, published by O'Reilly.
2323
Basic Examples
2424
--------------
2525

26-
The following example shows how the :ref:`command-line-interface`
26+
The following example shows how the :ref:`timeit-command-line-interface`
2727
can be used to compare three different expressions:
2828

2929
.. code-block:: sh
@@ -174,7 +174,7 @@ The module defines three convenience functions and a public class:
174174
where the traceback is sent; it defaults to :data:`sys.stderr`.
175175

176176

177-
.. _command-line-interface:
177+
.. _timeit-command-line-interface:
178178

179179
Command-Line Interface
180180
----------------------

Doc/library/warnings.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ Updating Code For New Versions of Python
265265

266266
Warnings that are only of interest to the developer are ignored by default. As
267267
such you should make sure to test your code with typically ignored warnings
268-
made visible. You can do this from the command-line by passing :option:`-Wd`
268+
made visible. You can do this from the command-line by passing :option:`-Wd <-W>`
269269
to the interpreter (this is shorthand for :option:`-W default`). This enables
270270
default handling for all warnings, including those that are ignored by default.
271271
To change what action is taken for encountered warnings you simply change what

Doc/library/zipapp.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Python code, which can be :ref:`executed directly by the Python interpreter
2323
Basic Example
2424
-------------
2525

26-
The following example shows how the :ref:`command-line-interface`
26+
The following example shows how the :ref:`zipapp-command-line-interface`
2727
can be used to create an executable archive from a directory containing
2828
Python code. When run, the archive will execute the ``main`` function from
2929
the module ``myapp`` in the archive.

Doc/whatsnew/2.3.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ Here are all of the changes that Python 2.3 makes to the core Python language.
10571057
* A new warning, :exc:`PendingDeprecationWarning` was added to indicate features
10581058
which are in the process of being deprecated. The warning will *not* be printed
10591059
by default. To check for use of features that will be deprecated in the future,
1060-
supply :option:`-Walways::PendingDeprecationWarning::` on the command line or
1060+
supply :option:`-Walways::PendingDeprecationWarning:: <-W>` on the command line or
10611061
use :func:`warnings.filterwarnings`.
10621062

10631063
* The process of deprecating string-based exceptions, as in ``raise "Error
@@ -1734,7 +1734,7 @@ The optparse Module
17341734
The :mod:`getopt` module provides simple parsing of command-line arguments. The
17351735
new :mod:`optparse` module (originally named Optik) provides more elaborate
17361736
command-line parsing that follows the Unix conventions, automatically creates
1737-
the output for :option:`--help`, and can perform different actions for different
1737+
the output for :option:`!--help`, and can perform different actions for different
17381738
options.
17391739

17401740
You start by creating an instance of :class:`OptionParser` and telling it what
@@ -1973,7 +1973,7 @@ Some of the more notable changes are:
19731973
the Python program as part of its execution.
19741974

19751975
* The :file:`regrtest.py` script now provides a way to allow "all resources
1976-
except *foo*." A resource name passed to the :option:`-u` option can now be
1976+
except *foo*." A resource name passed to the :option:`!-u` option can now be
19771977
prefixed with a hyphen (``'-'``) to mean "remove this resource." For example,
19781978
the option '``-uall,-bsddb``' could be used to enable the use of all resources
19791979
except ``bsddb``.

Doc/whatsnew/2.4.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,8 +1483,8 @@ Some of the changes to Python's build process and to the C API are:
14831483
intended as an aid to people developing the Python core. Providing
14841484
:option:`----enable-profiling` to the :program:`configure` script will let you
14851485
profile the interpreter with :program:`gprof`, and providing the
1486-
:option:`----with-tsc` switch enables profiling using the Pentium's Time-Stamp-
1487-
Counter register. Note that the :option:`----with-tsc` switch is slightly
1486+
:option:`--with-tsc` switch enables profiling using the Pentium's Time-Stamp-
1487+
Counter register. Note that the :option:`--with-tsc` switch is slightly
14881488
misnamed, because the profiling feature also works on the PowerPC platform,
14891489
though that processor architecture doesn't call that register "the TSC
14901490
register". (Contributed by Jeremy Hylton.)

Doc/whatsnew/2.5.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ Here are all of the changes that Python 2.5 makes to the core Python language.
10951095
log all the paths searched. In Python 2.5, a new :exc:`ImportWarning` warning is
10961096
triggered when an import would have picked up a directory as a package but no
10971097
:file:`__init__.py` was found. This warning is silently ignored by default;
1098-
provide the :option:`-Wd` option when running the Python executable to display
1098+
provide the :option:`-Wd <-W>` option when running the Python executable to display
10991099
the warning message. (Implemented by Thomas Wouters.)
11001100

11011101
* The list of base classes in a class definition can now be empty. As an
@@ -1126,7 +1126,7 @@ or ``exit()`` will now exit the interpreter as they expect. (Implemented by
11261126
Georg Brandl.)
11271127

11281128
The Python executable now accepts the standard long options :option:`--help`
1129-
and :option:`--version`; on Windows, it also accepts the :option:`/?` option
1129+
and :option:`--version`; on Windows, it also accepts the :option:`/? <-?>` option
11301130
for displaying a help message. (Implemented by Georg Brandl.)
11311131

11321132
.. ======================================================================
@@ -1640,7 +1640,7 @@ complete list of changes, or look through the SVN logs for all the details.
16401640
* The :mod:`webbrowser` module received a number of enhancements. It's now
16411641
usable as a script with ``python -m webbrowser``, taking a URL as the argument;
16421642
there are a number of switches to control the behaviour (:option:`-n` for a new
1643-
browser window, :option:`-t` for a new tab). New module-level functions,
1643+
browser window, :option:`!-t` for a new tab). New module-level functions,
16441644
:func:`open_new` and :func:`open_new_tab`, were added to support this. The
16451645
module's :func:`open` function supports an additional feature, an *autoraise*
16461646
parameter that signals whether to raise the open window when possible. A number

0 commit comments

Comments
 (0)