Commits

Jannis Leidel committed ba5814d

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

Comments (0)

Files changed (2)

pip/commands/install.py

                 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)):

pip/commands/uninstall.py

-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'
         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()