#NEWLINE# def create_parser( self ) : #NEWLINE# #INDENT# default_root = self . default_repo_path #NEWLINE# if ( not default_root ) : #NEWLINE# #INDENT# default_root = os . environ . get ( ( '%s_ROOT' % TOOL_NAME . upper ( ) ) ) #NEWLINE# #UNINDENT# if ( not default_root ) : #NEWLINE# #INDENT# default_root = os . path . join ( os . environ [ 'HOME' ] , ( '.%s' % TOOL_NAME ) , 'default' ) #NEWLINE# #UNINDENT# parser = argh . ArghParser ( ) #NEWLINE# parser . add_argument ( '-E' , '--pass-thru-exceptions' , default = False , action = 'store_true' , help = 'do not suppress exceptions with user-friendly error messages' ) #NEWLINE# parser . add_argument ( '-D' , '--debug' , dest = 'debug' , default = False , action = 'store_true' , help = 'enable debug output' ) #NEWLINE# parser . add_argument ( '-L' , '--time-log' , metavar = 'FILE' , help = 'update execution times to a file' ) #NEWLINE# parser . add_argument ( '-T' , '--clock' , metavar = 'NAME' , dest = 'time_op' , help = 'time-log this operation as NAME' ) #NEWLINE# parser . add_argument ( '-d' , '--root-dir' , dest = 'root_dir' , default = default_root , type = os . path . abspath , metavar = 'DIR' , help = 'repository root directory (default: $HOME/.poni/default)' ) #NEWLINE# parser . add_argument ( '-c' , '--color' , default = 'auto' , choices = [ 'on' , 'off' , 'auto' ] , help = 'use color highlighting' ) #NEWLINE# commands = [ self . handle_list , self . handle_add_system , self . handle_init , self . handle_import , self . handle_script , self . handle_add_config , self . handle_update_config , self . handle_remove_config , self . handle_control , self . handle_require , self . handle_add_library , self . handle_set , self . handle_show , self . handle_deploy , self . handle_audit , self . handle_verify , self . handle_add_node , self . handle_report , self . handle_version ] #NEWLINE# commands . sort ( key = ( lambda func : func . __name__ ) ) #NEWLINE# parser . add_commands ( commands ) #NEWLINE# parser . add_commands ( [ self . handle_cloud_init , self . handle_cloud_terminate , self . handle_cloud_update , self . handle_cloud_wait , self . handle_cloud_ip , self . handle_cloud_create_snapshot , self . handle_cloud_revert_to_snapshot , self . handle_cloud_remove_snapshot , self . handle_cloud_power_off , self . handle_cloud_power_on ] , namespace = 'cloud' , title = 'cloud operations' , help = 'command to execute' ) #NEWLINE# parser . add_commands ( [ self . handle_remote_exec , self . handle_remote_shell , self . handle_remote_cp ] , namespace = 'remote' , title = 'remote operations' , help = 'command to execute' ) #NEWLINE# parser . add_commands ( [ self . handle_vc_init , self . handle_vc_diff , self . handle_vc_checkpoint ] , namespace = 'vc' , title = 'version-control operations' , help = 'command to execute' ) #NEWLINE# parser . add_commands ( [ self . handle_settings_list , self . handle_settings_set ] , namespace = 'settings' , title = 'config settings manipulation commands' , help = 'command to execute' ) #NEWLINE# return parser