Stylistic/formatting changes to Rene Liebscher's '--help-xxx' patch.
diff --git a/Lib/distutils/command/bdist.py b/Lib/distutils/command/bdist.py
index 66ef113..1646993 100644
--- a/Lib/distutils/command/bdist.py
+++ b/Lib/distutils/command/bdist.py
@@ -21,7 +21,7 @@
user_options = [('bdist-base=', 'b',
"temporary directory for creating built distributions"),
('formats=', None,
- "formats for distribution"),
+ "formats for distribution (comma-separated list)"),
]
# The following commands do not take a format option from bdist
@@ -32,22 +32,24 @@
default_format = { 'posix': 'gztar',
'nt': 'zip', }
- format_command = { 'gztar': ('bdist_dumb',"gzipped tar-file"),
- 'bztar': ('bdist_dumb',"bzip2-ed tar-file"),
- 'ztar': ('bdist_dumb',"compressed tar-file"),
- 'tar': ('bdist_dumb',"tar-file"),
- 'rpm': ('bdist_rpm',"rpm distribution"),
- 'zip': ('bdist_dumb',"zip-file"),
+ format_command = { 'rpm': ('bdist_rpm', "RPM distribution"),
+ 'gztar': ('bdist_dumb', "gzip'ed tar file"),
+ 'bztar': ('bdist_dumb', "bzip2'ed tar file"),
+ 'ztar': ('bdist_dumb', "compressed tar file"),
+ 'tar': ('bdist_dumb', "tar file"),
+ 'zip': ('bdist_dumb', "ZIP file"),
}
- # prints all possible arguments to --format
- def show_formats():
+ def show_formats ():
+ """Print list of available formats (arguments to "--format" option).
+ """
from distutils.fancy_getopt import FancyGetopt
- list_of_formats=[]
+ formats=[]
for format in bdist.format_command.keys():
- list_of_formats.append(("formats="+format,None,bdist.format_command[format][1]))
- list_of_formats.sort()
- pretty_printer=FancyGetopt(list_of_formats)
+ formats.append(("formats="+format, None,
+ bdist.format_command[format][1]))
+ formats.sort()
+ pretty_printer = FancyGetopt(formats)
pretty_printer.print_help("List of available distribution formats:")
help_options = [
@@ -87,7 +89,6 @@
def run (self):
for format in self.formats:
-
try:
cmd_name = self.format_command[format][0]
except KeyError:
diff --git a/Lib/distutils/command/build.py b/Lib/distutils/command/build.py
index c064f83..d5513fc 100644
--- a/Lib/distutils/command/build.py
+++ b/Lib/distutils/command/build.py
@@ -36,9 +36,10 @@
('force', 'f',
"forcibly build everything (ignore file timestamps)"),
]
+
help_options = [
('help-compiler', None,
- "lists available compilers",show_compilers),
+ "list available compilers", show_compilers),
]
def initialize_options (self):
diff --git a/Lib/distutils/command/build_clib.py b/Lib/distutils/command/build_clib.py
index 72df372..9a82ac0 100644
--- a/Lib/distutils/command/build_clib.py
+++ b/Lib/distutils/command/build_clib.py
@@ -42,9 +42,10 @@
('compiler=', 'c',
"specify the compiler type"),
]
+
help_options = [
('help-compiler', None,
- "lists available compilers",show_compilers),
+ "list available compilers", show_compilers),
]
def initialize_options (self):
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py
index ded8ec2..93e53bb 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -36,7 +36,7 @@
('force-manifest', 'f',
"forcibly regenerate the manifest and carry on as usual"),
('formats=', None,
- "formats for source distribution"),
+ "formats for source distribution (comma-separated list)"),
('keep-tree', 'k',
"keep the distribution tree around after creating " +
"archive file(s)"),
@@ -61,7 +61,7 @@
help_options = [
('help-formats', None,
- "lists available distribution formats", show_formats),
+ "list available distribution formats", show_formats),
]
negative_opts = {'use-defaults': 'no-defaults'}