1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Also bail in the uninstall command, if no requirement is given.

This commit is contained in:
Jannis Leidel 2010-08-31 14:51:15 +02:00
parent 40c153d084
commit d921b1dc55
2 changed files with 7 additions and 5 deletions

View file

@ -205,8 +205,8 @@ class InstallCommand(Command):
raise InstallationError('You must give at least one '
'requirement to %s (maybe you meant "pip install %s"?)'
% (self.name, " ".join(options.find_links)))
raise InstallationError('You must give at least one '
'requirement to %s (see "pip help install")' % self.name)
raise InstallationError('You must give at least one requirement '
'to %(name)s (see "pip help %(name)s")' % dict(name=self.name))
if (options.use_user_site and
sys.version_info < (2, 6)):

View file

@ -1,7 +1,6 @@
from pip.req import InstallRequirement, RequirementSet
from pip.req import parse_requirements
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.basecommand import Command
from pip.exceptions import InstallationError
class UninstallCommand(Command):
name = 'uninstall'
@ -35,6 +34,9 @@ class UninstallCommand(Command):
for filename in options.requirements:
for req in parse_requirements(filename, options=options):
requirement_set.add_requirement(req)
if not requirement_set.has_requirements:
raise InstallationError('You must give at least one requirement '
'to %(name)s (see "pip help %(name)s")' % dict(name=self.name))
requirement_set.uninstall(auto_confirm=options.yes)
UninstallCommand()