#NEWLINE# def main( argv = None , compiler = None ) : #NEWLINE# #INDENT# 'Run the compiler command-line interface.' #NEWLINE# argv = ( argv or sys . argv [ 1 : ] ) #NEWLINE# _logging ( argv ) #NEWLINE# try : #NEWLINE# #INDENT# compiler = ( compiler or pdefc ) #NEWLINE# parser = create_parser ( compiler ) #NEWLINE# args = parser . parse_args ( argv ) #NEWLINE# logging . debug ( 'Arguments: %s' , args ) #NEWLINE# func = args . command_func #NEWLINE# if ( not func ) : #NEWLINE# #INDENT# raise ValueError ( ( 'No "command_func" in args %s' % args ) ) #NEWLINE# #UNINDENT# return func ( args ) #NEWLINE# #UNINDENT# except pdefc . CompilerException as e : #NEWLINE# #INDENT# logging . error ( '%s' , e ) #NEWLINE# if e . errors : #NEWLINE# #INDENT# logging . error ( '%s' , '\n' . join ( e . errors ) ) #NEWLINE# #UNINDENT# sys . exit ( 1 )