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:
parent
5fae811bf2
commit
660253c20f
1 changed files with 8 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue