#NEWLINE# def __call__( self , args , parsed_globals ) : #NEWLINE# #INDENT# self . _subcommand_table = self . _build_subcommand_table ( ) #NEWLINE# self . _arg_table = self . _build_arg_table ( ) #NEWLINE# event = ( 'before-building-argument-table-parser.%s' % '.' . join ( self . lineage_names ) ) #NEWLINE# self . _session . emit ( event , argument_table = self . _arg_table , args = args , session = self . _session ) #NEWLINE# parser = ArgTableArgParser ( self . arg_table , self . subcommand_table ) #NEWLINE# ( parsed_args , remaining ) = parser . parse_known_args ( args ) #NEWLINE# for ( key , value ) in vars ( parsed_args ) . items ( ) : #NEWLINE# #INDENT# cli_argument = None #NEWLINE# xformed = key . replace ( '_' , '-' ) #NEWLINE# if ( xformed in self . arg_table ) : #NEWLINE# #INDENT# cli_argument = self . arg_table [ xformed ] #NEWLINE# #UNINDENT# value = unpack_argument ( self . _session , 'custom' , self . name , cli_argument , value ) #NEWLINE# if self . _should_allow_plugins_override ( cli_argument , value ) : #NEWLINE# #INDENT# override = self . _session . emit_first_non_none_response ( ( 'process-cli-arg.%s.%s' % ( 'custom' , self . name ) ) , cli_argument = cli_argument , value = value , operation = None ) #NEWLINE# if ( override is not None ) : #NEWLINE# #INDENT# value = override #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# value = unpack_cli_arg ( cli_argument , value ) #NEWLINE# #UNINDENT# self . _validate_value_against_schema ( cli_argument . argument_model , value ) #NEWLINE# #UNINDENT# setattr ( parsed_args , key , value ) #NEWLINE# #UNINDENT# if hasattr ( parsed_args , 'help' ) : #NEWLINE# #INDENT# self . _display_help ( parsed_args , parsed_globals ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( getattr ( parsed_args , 'subcommand' , None ) is None ) : #NEWLINE# #INDENT# if remaining : #NEWLINE# #INDENT# raise ValueError ( ( 'Unknown options: %s' % ',' . join ( remaining ) ) ) #NEWLINE# #UNINDENT# return self . _run_main ( parsed_args , parsed_globals ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return self . subcommand_table [ parsed_args . subcommand ] ( remaining , parsed_globals )