summaryrefslogtreecommitdiff
path: root/Lib/distutils/command/sdist.py
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-06-07 03:00:06 +0000
committerGreg Ward <gward@python.net>2000-06-07 03:00:06 +0000
commit9d17a7ad6df0a940f8f10cf7a113aaffc4222309 (patch)
tree825174ee769bf6ab27252f9a2965ed2b81680fb5 /Lib/distutils/command/sdist.py
parent1169687692e5e897033421fe6a73a3c32675a7d7 (diff)
downloadcpython-git-9d17a7ad6df0a940f8f10cf7a113aaffc4222309.tar.gz
Patch from Rene Liebscher: this adds "--help-foo" options to list the
values that "--foo" can take for various commands: eg. what formats for "sdist" and "bdist", what compilers for "build_ext" and "build_clib". I have *not* reviewed this patch; I'm checking it in as-is because it also fixes a paper-bag-over-head bug in bdist.py, and because I won't have time to review it properly for several days: so someone else can test it for me, instead!
Diffstat (limited to 'Lib/distutils/command/sdist.py')
-rw-r--r--Lib/distutils/command/sdist.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py
index af88eba07a..221a4d9934 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -13,7 +13,7 @@ from glob import glob
from distutils.core import Command
from distutils.util import newer, create_tree, remove_tree, convert_path, \
write_file
-from distutils.archive_util import check_archive_formats
+from distutils.archive_util import check_archive_formats,ARCHIVE_FORMATS
from distutils.text_file import TextFile
from distutils.errors import DistutilsExecError, DistutilsOptionError
@@ -35,11 +35,26 @@ class sdist (Command):
('force-manifest', 'f',
"forcibly regenerate the manifest and carry on as usual"),
('formats=', None,
- "formats for source distribution (tar, ztar, gztar, bztar, or zip)"),
+ "formats for source distribution"),
('keep-tree', 'k',
"keep the distribution tree around after creating " +
"archive file(s)"),
]
+ # prints all possible arguments to --formats
+ def show_formats():
+ from distutils.fancy_getopt import FancyGetopt
+ list_of_formats=[]
+ for format in ARCHIVE_FORMATS.keys():
+ list_of_formats.append(("formats="+format,None,ARCHIVE_FORMATS[format][2]))
+ list_of_formats.sort()
+ pretty_printer=FancyGetopt(list_of_formats)
+ pretty_printer.print_help("List of available distribution formats:")
+
+ help_options = [
+ ('help-formats', None,
+ "lists available distribution formats",show_formats),
+ ]
+
negative_opts = {'use-defaults': 'no-defaults'}
default_format = { 'posix': 'gztar',