<s> from pip . basecommand import Command , SUCCESS <EOL> from pip . exceptions import CommandError <EOL> class HelpCommand ( Command ) : <EOL> """<STR_LIT>""" <EOL> name = '<STR_LIT>' <EOL> usage = """<STR_LIT>""" <EOL> summary = '<STR_LIT>' <EOL> def run ( self , options , args ) : <EOL> from pip . commands import commands , get_similar_commands <EOL> try : <EOL> cmd_name = args [ <NUM_LIT:0> ] <EOL> except IndexError : <EOL> return SUCCESS <EOL> if cmd_name not in commands : <EOL> guess = get_similar_commands ( cmd_name ) <EOL> msg = [ '<STR_LIT>' % cmd_name ] <EOL> if guess : <EOL> msg . append ( '<STR_LIT>' % guess ) <EOL> raise CommandError ( '<STR_LIT>' . join ( msg ) ) <EOL> command = commands [ cmd_name ] ( self . main_parser ) <EOL> command . parser . print_help ( ) <EOL> return SUCCESS </s>
