aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/easy_install.py
diff options
context:
space:
mode:
authorPhilip Jenvey <pjenvey@underboss.org>2009-08-09 19:39:18 -0700
committerPhilip Jenvey <pjenvey@underboss.org>2009-08-09 19:39:18 -0700
commita95877cd71522f5a2f5af90e2e2bfaa5d33ab3e2 (patch)
treebe943ea991b7b05bfa313b5639e008123e688f74 /setuptools/command/easy_install.py
parentc9029603df0ca944e958c6d753cf1257e02bd365 (diff)
downloadexternal_python_setuptools-a95877cd71522f5a2f5af90e2e2bfaa5d33ab3e2.tar.gz
external_python_setuptools-a95877cd71522f5a2f5af90e2e2bfaa5d33ab3e2.tar.bz2
external_python_setuptools-a95877cd71522f5a2f5af90e2e2bfaa5d33ab3e2.zip
add --version to easy_install
fixes #4 (transplanted from 29b03bd8ae436ac26767f42bc77b0bfefa8a6e7a) --HG-- branch : distribute extra : rebase_source : e97203ec652e0fea0744ad60819cd52e686bf449
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-xsetuptools/command/easy_install.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 228a9a69..3f8a6877 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -71,11 +71,12 @@ class easy_install(Command):
('no-deps', 'N', "don't install dependencies"),
('allow-hosts=', 'H', "pattern(s) that hostnames must match"),
('local-snapshots-ok', 'l', "allow building eggs from local checkouts"),
+ ('version', None, "print version information and exit"),
]
boolean_options = [
'zip-ok', 'multi-version', 'exclude-scripts', 'upgrade', 'always-copy',
'delete-conflicting', 'ignore-conflicts-at-my-risk', 'editable',
- 'no-deps', 'local-snapshots-ok',
+ 'no-deps', 'local-snapshots-ok', 'version'
]
negative_opt = {'always-unzip': 'zip-ok'}
create_index = PackageIndex
@@ -91,6 +92,7 @@ class easy_install(Command):
self.upgrade = self.always_copy = self.multi_version = None
self.editable = self.no_deps = self.allow_hosts = None
self.root = self.prefix = self.no_report = None
+ self.version = None
# Options not specifiable via command line
self.package_index = None
@@ -122,6 +124,10 @@ class easy_install(Command):
os.unlink(filename)
def finalize_options(self):
+ if self.version:
+ print 'distribute %s' % get_distribution('distribute').version
+ sys.exit()
+
self._expand('install_dir','script_dir','build_directory','site_dirs')
# If a non-default installation directory was specified, default the
# script directory to match it.