#NEWLINE# def parse( args = None ) : #NEWLINE# #INDENT# parser = argparse . ArgumentParser ( description = 'Command line interface for Xcode server.' ) #NEWLINE# sub_parsers = parser . add_subparsers ( title = 'Commands' , dest = 'sub' ) #NEWLINE# parser . add_argument ( '--version' , help = 'Display version' , action = 'count' ) #NEWLINE# add_bot_parser ( sub_parsers ) #NEWLINE# add_integrate_parser ( args ) #NEWLINE# add_init_flags ( sub_parsers ) #NEWLINE# if has_pre_parse ( parser ) : #NEWLINE# #INDENT# return pre_parse ( ) #NEWLINE# #UNINDENT# parsed_args = parser . parse_args ( args ) #NEWLINE# parsed_args . bots = ( parsed_args . sub == 'bots' ) #NEWLINE# parsed_args . integrations = ( parsed_args . sub == 'list' ) #NEWLINE# parsed_args . integrate = ( parsed_args . sub == 'new' ) #NEWLINE# parsed_args . cancel = ( parsed_args . sub == 'cancel' ) #NEWLINE# parsed_args . init = ( parsed_args . sub == 'init' ) #NEWLINE# parsed_args . running = ( parsed_args . sub == 'running' ) #NEWLINE# return parsed_args