#NEWLINE# def cmd_help( self , argv , help ) : #NEWLINE# #INDENT# 'Print help' #NEWLINE# parser = argparse . ArgumentParser ( prog = ( '%s help' % self . progname ) , description = help ) #NEWLINE# parser . add_argument ( '-z' , '--zsh' , action = 'store_true' , help = 'Print info for zsh autocompletion' ) #NEWLINE# parser . add_argument ( 'command' , nargs = '?' , metavar = 'command' , help = 'Name of the command you want help for.' , choices = self . subparsers . keys ( ) ) #NEWLINE# args = parser . parse_args ( argv ) #NEWLINE# if args . zsh : #NEWLINE# #INDENT# if ( args . command is None ) : #NEWLINE# #INDENT# for cmd in self . subparsers . keys ( ) : #NEWLINE# #INDENT# print ( cmd ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( self . cmds [ args . command ] , 'get_completion' ) : #NEWLINE# #INDENT# for item in self . cmds [ args . command ] . get_completion ( ) : #NEWLINE# #INDENT# print ( item ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( args . command in ( 'do' , 'ssh' ) ) : #NEWLINE# #INDENT# for instance in self . get_instances ( command = 'init_ssh_key' ) : #NEWLINE# #INDENT# print ( instance ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( args . command == 'debug' ) : #NEWLINE# #INDENT# for instance in sorted ( self . instances ) : #NEWLINE# #INDENT# print ( instance ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( args . command == 'list' ) : #NEWLINE# #INDENT# for subcmd in sorted ( self . list_cmds ) : #NEWLINE# #INDENT# print ( subcmd ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( args . command != 'help' ) : #NEWLINE# #INDENT# for instance in sorted ( self . get_instances ( command = args . command ) ) : #NEWLINE# #INDENT# print ( instance ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( args . command is None ) : #NEWLINE# #INDENT# parser . print_help ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cmd = self . cmds [ args . command ] #NEWLINE# cmd ( [ '-h' ] , cmd . __doc__ )