Skip to content

Commit 5c67933

Browse files
committed
Issue #26638: Mask undefined CLI options to defeat new Sphinx warnings
1 parent 62fe1bb commit 5c67933

22 files changed

+122
-122
lines changed

Doc/distutils/apiref.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ the full reference.
205205
| | to or ``None`` to define it | |
206206
| | without a particular value | |
207207
| | (equivalent of ``#define FOO`` | |
208-
| | in source or :option:`-DFOO` | |
208+
| | in source or :option:`!-DFOO` | |
209209
| | on Unix C compiler command | |
210210
| | line) | |
211211
+------------------------+--------------------------------+---------------------------+
@@ -319,11 +319,11 @@ 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,)``
325325
means undefine (:option:`!-U`) macro *name*, and ``(name, value)`` means define
326-
(:option:`-D`) macro *name* to *value*. *include_dirs* is just a list of
326+
(:option:`!-D`) macro *name* to *value*. *include_dirs* is just a list of
327327
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++.
@@ -359,7 +359,7 @@ This module provides the following functions.
359359
360360
.. function:: show_compilers()
361361

362-
Print list of available compilers (used by the :option:`--help-compiler` options
362+
Print list of available compilers (used by the :option:`!--help-compiler` options
363363
to :command:`build`, :command:`build_ext`, :command:`build_clib`).
364364

365365

@@ -789,23 +789,23 @@ This module provides the following functions.
789789
This module provides the :class:`UnixCCompiler` class, a subclass of
790790
:class:`CCompiler` that handles the typical Unix-style command-line C compiler:
791791

792-
* macros defined with :option:`-Dname[=value]`
792+
* macros defined with :option:`!-Dname[=value]`
793793

794-
* macros undefined with :option:`-Uname`
794+
* macros undefined with :option:`!-Uname`
795795

796-
* include search directories specified with :option:`-Idir`
796+
* include search directories specified with :option:`!-Idir`
797797

798-
* libraries specified with :option:`-llib`
798+
* libraries specified with :option:`!-llib`
799799

800-
* library search directories specified with :option:`-Ldir`
800+
* library search directories specified with :option:`!-Ldir`
801801

802802
* 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
806806
:program:`ranlib`)
807807

808-
* link shared library handled by :program:`cc` :option:`-shared`
808+
* link shared library handled by :program:`cc` :option:`!-shared`
809809

810810

811811
:mod:`distutils.msvccompiler` --- Microsoft Compiler
@@ -1318,8 +1318,8 @@ provides the following additional features:
13181318

13191319
* options set attributes of a passed-in object
13201320

1321-
* boolean options can have "negative aliases" --- eg. if :option:`--quiet` is
1322-
the "negative alias" of :option:`--verbose`, then :option:`--quiet` on the
1321+
* boolean options can have "negative aliases" --- eg. if :option:`!--quiet` is
1322+
the "negative alias" of :option:`!--verbose`, then :option:`!--quiet` on the
13231323
command line sets *verbose* to false.
13241324

13251325
.. function:: fancy_getopt(options, negative_opt, object, args)

Doc/distutils/builtdist.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ built distributions, such as an RPM package or an executable installer for
5757
Windows, is far more convenient for users even if your distribution doesn't
5858
include any extensions.
5959

60-
The :command:`bdist` command has a :option:`--formats` option, similar to the
60+
The :command:`bdist` command has a :option:`!--formats` option, similar to the
6161
:command:`sdist` command, which you can use to select the types of built
6262
distribution to generate: for example, ::
6363

@@ -123,7 +123,7 @@ Notes:
123123
requires external :program:`rpm` utility, version 3.0.4 or better (use ``rpm
124124
--version`` to find out which version you have)
125125

126-
You don't have to use the :command:`bdist` command with the :option:`--formats`
126+
You don't have to use the :command:`bdist` command with the :option:`!--formats`
127127
option; you can also use the command that directly implements the format you're
128128
interested in. Some of these :command:`bdist` "sub-commands" actually generate
129129
several similar formats; for instance, the :command:`bdist_dumb` command
@@ -174,7 +174,7 @@ The usual way to create an RPM of your module distribution is to run the
174174

175175
python setup.py bdist_rpm
176176

177-
or the :command:`bdist` command with the :option:`--format` option::
177+
or the :command:`bdist` command with the :option:`!--format` option::
178178

179179
python setup.py bdist --formats=rpm
180180

@@ -249,7 +249,7 @@ configuration file, :file:`setup.cfg`\ ---see section :ref:`setup-config`. If
249249
you distribute or package many Python module distributions, you might want to
250250
put options that apply to all of them in your personal Distutils configuration
251251
file (:file:`~/.pydistutils.cfg`). If you want to temporarily disable
252-
this file, you can pass the :option:`--no-user-cfg` option to :file:`setup.py`.
252+
this file, you can pass the :option:`!--no-user-cfg` option to :file:`setup.py`.
253253

254254
There are three steps to building a binary RPM package, all of which are
255255
handled automatically by the Distutils:
@@ -267,10 +267,10 @@ Normally, RPM bundles the last two steps together; when you use the Distutils,
267267
all three steps are typically bundled together.
268268

269269
If you wish, you can separate these three steps. You can use the
270-
:option:`--spec-only` option to make :command:`bdist_rpm` just create the
270+
:option:`!--spec-only` option to make :command:`bdist_rpm` just create the
271271
:file:`.spec` file and exit; in this case, the :file:`.spec` file will be
272272
written to the "distribution directory"---normally :file:`dist/`, but
273-
customizable with the :option:`--dist-dir` option. (Normally, the :file:`.spec`
273+
customizable with the :option:`!--dist-dir` option. (Normally, the :file:`.spec`
274274
file winds up deep in the "build tree," in a temporary directory created by
275275
:command:`bdist_rpm`.)
276276

@@ -307,7 +307,7 @@ is usually as easy as running::
307307

308308
python setup.py bdist_wininst
309309

310-
or the :command:`bdist` command with the :option:`--formats` option::
310+
or the :command:`bdist` command with the :option:`!--formats` option::
311311

312312
python setup.py bdist --formats=wininst
313313

@@ -325,20 +325,20 @@ support.
325325
The installer will try to compile pure modules into :term:`bytecode` after installation
326326
on the target system in normal and optimizing mode. If you don't want this to
327327
happen for some reason, you can run the :command:`bdist_wininst` command with
328-
the :option:`--no-target-compile` and/or the :option:`--no-target-optimize`
328+
the :option:`!--no-target-compile` and/or the :option:`!--no-target-optimize`
329329
option.
330330

331331
By default the installer will display the cool "Python Powered" logo when it is
332332
run, but you can also supply your own 152x261 bitmap which must be a Windows
333-
:file:`.bmp` file with the :option:`--bitmap` option.
333+
:file:`.bmp` file with the :option:`!--bitmap` option.
334334

335335
The installer will also display a large title on the desktop background window
336336
when it is run, which is constructed from the name of your distribution and the
337337
version number. This can be changed to another text by using the
338-
:option:`--title` option.
338+
:option:`!--title` option.
339339

340340
The installer file will be written to the "distribution directory" --- normally
341-
:file:`dist/`, but customizable with the :option:`--dist-dir` option.
341+
:file:`dist/`, but customizable with the :option:`!--dist-dir` option.
342342

343343
.. _cross-compile-windows:
344344

@@ -350,7 +350,7 @@ Windows platforms. In practice, this means that with the correct tools
350350
installed, you can use a 32bit version of Windows to create 64bit extensions
351351
and vice-versa.
352352

353-
To build for an alternate platform, specify the :option:`--plat-name` option
353+
To build for an alternate platform, specify the :option:`!--plat-name` option
354354
to the build command. Valid values are currently 'win32', 'win-amd64' and
355355
'win-ia64'. For example, on a 32bit version of Windows, you could execute::
356356

@@ -383,14 +383,14 @@ The Postinstallation script
383383
---------------------------
384384

385385
Starting with Python 2.3, a postinstallation script can be specified with the
386-
:option:`--install-script` option. The basename of the script must be
386+
:option:`!--install-script` option. The basename of the script must be
387387
specified, and the script filename must also be listed in the scripts argument
388388
to the setup function.
389389

390390
This script will be run at installation time on the target system after all the
391-
files have been copied, with ``argv[1]`` set to :option:`-install`, and again at
391+
files have been copied, with ``argv[1]`` set to :option:`!-install`, and again at
392392
uninstallation time before the files are removed with ``argv[1]`` set to
393-
:option:`-remove`.
393+
:option:`!-remove`.
394394

395395
The installation script runs embedded in the windows installer, every output
396396
(``sys.stdout``, ``sys.stderr``) is redirected into a buffer and will be
@@ -453,7 +453,7 @@ built-in functions in the installation script.
453453
Vista User Access Control (UAC)
454454
===============================
455455

456-
Starting with Python 2.6, bdist_wininst supports a :option:`--user-access-control`
456+
Starting with Python 2.6, bdist_wininst supports a :option:`!--user-access-control`
457457
option. The default is 'none' (meaning no UAC handling is done), and other
458458
valid values are 'auto' (meaning prompt for UAC elevation if Python was
459459
installed for all users) and 'force' (meaning always prompt for elevation).

Doc/distutils/configfile.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ universal :option:`!--help` option, e.g. ::
6666
--swig-opts list of SWIG command line options
6767
[...]
6868

69-
Note that an option spelled :option:`--foo-bar` on the command-line is spelled
69+
Note that an option spelled :option:`!--foo-bar` on the command-line is spelled
7070
``foo_bar`` in configuration files.
7171

7272
.. _distutils-build-ext-inplace:
@@ -75,12 +75,12 @@ For example, say you want your extensions to be built "in-place"---that is, you
7575
have an extension :mod:`pkg.ext`, and you want the compiled extension file
7676
(:file:`ext.so` on Unix, say) to be put in the same source directory as your
7777
pure Python modules :mod:`pkg.mod1` and :mod:`pkg.mod2`. You can always use the
78-
:option:`--inplace` option on the command-line to ensure this::
78+
:option:`!--inplace` option on the command-line to ensure this::
7979

8080
python setup.py build_ext --inplace
8181

8282
But this requires that you always specify the :command:`build_ext` command
83-
explicitly, and remember to provide :option:`--inplace`. An easier way is to
83+
explicitly, and remember to provide :option:`!--inplace`. An easier way is to
8484
"set and forget" this option, by encoding it in :file:`setup.cfg`, the
8585
configuration file for this distribution::
8686

Doc/distutils/extending.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ requiring modifications to the Python installation. This is expected to allow
6262
third-party extensions to provide support for additional packaging systems, but
6363
the commands can be used for anything distutils commands can be used for. A new
6464
configuration option, ``command_packages`` (command-line option
65-
:option:`--command-packages`), can be used to specify additional packages to be
65+
:option:`!--command-packages`), can be used to specify additional packages to be
6666
searched for modules implementing commands. Like all distutils options, this
6767
can be specified on the command line or in a configuration file. This option
6868
can only be set in the ``[global]`` section of a configuration file, or before

Doc/distutils/setupscript.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ command line. Scripts don't require Distutils to do anything very complicated.
446446
The only clever feature is that if the first line of the script starts with
447447
``#!`` and contains the word "python", the Distutils will adjust the first line
448448
to refer to the current interpreter location. By default, it is replaced with
449-
the current interpreter location. The :option:`--executable` (or :option:`-e`)
449+
the current interpreter location. The :option:`!--executable` (or :option:`!-e`)
450450
option will allow the interpreter path to be explicitly overridden.
451451

452452
The ``scripts`` option simply is a list of files to be handled in this

Doc/distutils/sourcedist.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ or config file), :command:`sdist` creates the archive of the default format for
1414
the current platform. The default format is a gzip'ed tar file
1515
(:file:`.tar.gz`) on Unix, and ZIP file on Windows.
1616

17-
You can specify as many formats as you like using the :option:`--formats`
17+
You can specify as many formats as you like using the :option:`!--formats`
1818
option, for example::
1919

2020
python setup.py sdist --formats=gztar,zip
@@ -147,7 +147,7 @@ matching :file:`\*.txt` or :file:`\*.py`, and exclude all directories matching
147147
:file:`examples/sample?/build`. All of this is done *after* the standard
148148
include set, so you can exclude files from the standard set with explicit
149149
instructions in the manifest template. (Or, you can use the
150-
:option:`--no-defaults` option to disable the standard set entirely.) There are
150+
:option:`!--no-defaults` option to disable the standard set entirely.) There are
151151
several other commands available in the manifest template mini-language; see
152152
section :ref:`sdist-cmd`.
153153

@@ -166,8 +166,8 @@ Now we have our complete list of files, which is written to the manifest for
166166
future reference, and then used to build the source distribution archive(s).
167167

168168
You can disable the default set of included files with the
169-
:option:`--no-defaults` option, and you can disable the standard exclude set
170-
with :option:`--no-prune`.
169+
:option:`!--no-defaults` option, and you can disable the standard exclude set
170+
with :option:`!--no-prune`.
171171

172172
Following the Distutils' own manifest template, let's trace how the
173173
:command:`sdist` command builds the list of files to include in the Distutils
@@ -225,12 +225,12 @@ The normal course of operations for the :command:`sdist` command is as follows:
225225
in) to create the source distribution archive(s)
226226

227227
There are a couple of options that modify this behaviour. First, use the
228-
:option:`--no-defaults` and :option:`--no-prune` to disable the standard
228+
:option:`!--no-defaults` and :option:`!--no-prune` to disable the standard
229229
"include" and "exclude" sets.
230230

231231
Second, you might just want to (re)generate the manifest, but not create a source
232232
distribution::
233233

234234
python setup.py sdist --manifest-only
235235

236-
:option:`-o` is a shortcut for :option:`--manifest-only`.
236+
:option:`!-o` is a shortcut for :option:`!--manifest-only`.

Doc/extending/extending.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ The :mod:`gc` module exposes a way to run the detector (the
886886
:func:`~gc.collect` function), as well as configuration
887887
interfaces and the ability to disable the detector at runtime. The cycle
888888
detector is considered an optional component; though it is included by default,
889-
it can be disabled at build time using the :option:`--without-cycle-gc` option
889+
it can be disabled at build time using the :option:`!--without-cycle-gc` option
890890
to the :program:`configure` script on Unix platforms (including Mac OS X). If
891891
the cycle detector is disabled in this way, the :mod:`gc` module will not be
892892
available.

0 commit comments

Comments
 (0)