#NEWLINE# def start( ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# command = sys . argv [ 1 ] #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# command = 'help' #NEWLINE# #UNINDENT# if ( '--help' in sys . argv ) : #NEWLINE# #INDENT# command = 'help' #NEWLINE# #UNINDENT# args = sys . argv [ 2 : ] #NEWLINE# instance = SftpCli ( ) #NEWLINE# callback = getattr ( instance , ( 'command_%s' % command ) , None ) #NEWLINE# if isinstance ( callback , collections . Callable ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# callback ( * args ) #NEWLINE# #UNINDENT# except TypeError as e : #NEWLINE# #INDENT# sys . stderr . write ( ( 'Bad call for %s: %s' % ( command , str ( e ) ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# instance . command_help ( )