<s> import sys <EOL> from pip . basecommand import Command <EOL> BASE_COMPLETION = """<STR_LIT>""" <EOL> COMPLETION_SCRIPTS = { <EOL> '<STR_LIT>' : """<STR_LIT>""" , '<STR_LIT>' : """<STR_LIT>""" } <EOL> class CompletionCommand ( Command ) : <EOL> name = '<STR_LIT>' <EOL> summary = '<STR_LIT>' <EOL> hidden = True <EOL> def __init__ ( self ) : <EOL> super ( CompletionCommand , self ) . __init__ ( ) <EOL> self . parser . add_option ( <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> action = '<STR_LIT>' , <EOL> const = '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> self . parser . add_option ( <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> action = '<STR_LIT>' , <EOL> const = '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> def run ( self , options , args ) : <EOL> """<STR_LIT>""" <EOL> shells = COMPLETION_SCRIPTS . keys ( ) <EOL> shell_options = [ '<STR_LIT>' + shell for shell in sorted ( shells ) ] <EOL> if options . shell in shells : <EOL> script = COMPLETION_SCRIPTS . get ( options . shell , '<STR_LIT>' ) <EOL> print ( BASE_COMPLETION % { '<STR_LIT>' : script , '<STR_LIT>' : options . shell } ) <EOL> else : <EOL> sys . stderr . write ( '<STR_LIT>' % '<STR_LIT>' . join ( shell_options ) ) <EOL> CompletionCommand ( ) </s>
