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

changed error to go to stderr

This commit is contained in:
Hugo Lopes Tavares 2010-04-15 19:19:31 -03:00
parent 5fae811bf2
commit 660253c20f

View file

@ -1,3 +1,4 @@
import sys
from pip.basecommand import Command
BASE_COMPLETION = """
@ -48,7 +49,12 @@ class CompletionCommand(Command):
def run(self, options, args):
"""Prints the completion code of the given shell"""
script = COMPLETION_SCRIPTS.get(options.shell, '')
print BASE_COMPLETION % {'script': script, 'shell': options.shell}
shells = COMPLETION_SCRIPTS.keys()
shell_options = ['--'+shell for shell in sorted(shells)]
if options.shell in shells:
script = COMPLETION_SCRIPTS.get(options.shell, '')
print BASE_COMPLETION % {'script': script, 'shell': options.shell}
else:
sys.stderr.write('ERROR: You must pass %s\n' % ' or '.join(shell_options))
CompletionCommand()