diff options
author | Éric Araujo <merwok@netwok.org> | 2010-11-18 16:38:46 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2010-11-18 16:38:46 (GMT) |
commit | 713d3039dc7d5b8e1a8fdd0f3517fa7053175ed5 (patch) | |
tree | 99bdc854fa7a540ee5339de5a2a6888bdc7d003e /Doc/library/compileall.rst | |
parent | daa29d01b749daa4843bcac80bd0067a827cfb8a (diff) | |
download | cpython-713d3039dc7d5b8e1a8fdd0f3517fa7053175ed5.zip cpython-713d3039dc7d5b8e1a8fdd0f3517fa7053175ed5.tar.gz cpython-713d3039dc7d5b8e1a8fdd0f3517fa7053175ed5.tar.bz2 |
Fix usage of :option: in the docs (#9312).
:option: is used to create a link to an option of python, not to mark
up any instance of any arbitrary command-line option. These were
changed to ````.
For modules which do have a command-line interface, lists of options
have been properly marked up with the program/cmdoption directives
combo. Options defined in such blocks can be linked to with :option:
later in the same file, they won’t link to an option of python.
Finally, the markup of command-line fragments in optparse.rst has
been cleaned to use ``x`` instead of ``"x"``, keeping that latter
form for actual Python strings.
Patch by Eli Bendersky and Éric Araujo.
Diffstat (limited to 'Doc/library/compileall.rst')
-rw-r--r-- | Doc/library/compileall.rst | 58 |
1 files changed, 47 insertions, 11 deletions
diff --git a/Doc/library/compileall.rst b/Doc/library/compileall.rst index b0a2e34..63ddc99 100644 --- a/Doc/library/compileall.rst +++ b/Doc/library/compileall.rst @@ -10,16 +10,53 @@ libraries. These functions compile Python source files in a directory tree, allowing users without permission to write to the libraries to take advantage of cached byte-code files. -This module may also be used as a script (using the :option:`-m` Python flag) to -compile Python sources. Directories to recursively traverse (passing -:option:`-l` stops the recursive behavior) for sources are listed on the command -line. If no arguments are given, the invocation is equivalent to ``-l -sys.path``. Printing lists of the files compiled can be disabled with the -:option:`-q` flag. In addition, the :option:`-x` option takes a regular -expression argument. All files that match the expression will be skipped. -The :option:`-b` flag may be given to write legacy ``.pyc`` file path names, -otherwise :pep:`3147` style byte-compiled path names are written. +Command-line use +---------------- + +This module can work as a script (using :program:`python -m compileall`) to +compile Python sources. + +.. program:: compileall + +.. cmdoption:: [directory|file]... + + Positional arguments are files to compile or directories that contain + source files, traversed recursively. If no argument is given, behave as if + the command line was ``-l <directories from sys.path>``. + +.. cmdoption:: -l + + Do not recurse. + +.. cmdoption:: -f + + Force rebuild even if timestamps are up-to-date. + +.. cmdoption:: -q + + Do not print the list of files compiled. + +.. cmdoption:: -d destdir + + Purported directory name for error messages. + +.. cmdoption:: -x regex + + Skip files with a full path that matches given regular expression. + +.. cmdoption:: -i list + + Expand list with its content (file and directory names). + +.. cmdoption:: -b + + Write legacy ``.pyc`` file path names. Default is to write :pep:`3147`-style + byte-compiled path names. + + +Public functions +---------------- .. function:: compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, quiet=False, legacy=False) @@ -37,7 +74,7 @@ otherwise :pep:`3147` style byte-compiled path names are written. operation. If *legacy* is true, old-style ``.pyc`` file path names are written, - otherwise (the default), :pep:`3147` style path names are written. + otherwise (the default), :pep:`3147`-style path names are written. .. function:: compile_path(skip_curdir=True, maxlevels=0, force=False, legacy=False) @@ -64,4 +101,3 @@ subdirectory and all its subdirectories:: Module :mod:`py_compile` Byte-compile a single source file. - |