Class: ConfigCommand

Inherits:
Command show all
Defined in:
lib/clui_config.rb

Instance Attribute Summary

Attributes inherited from Command

#desc, #name

Instance Method Summary collapse

Methods inherited from Command

#add_arg, #add_cmd, #add_flow, #add_flow_from_usage, #add_input, #add_option, #add_options, #command_name?, #flow_passes_parse, #flow_passes_preconditions, #get_args_used, #init, #initialize, #option_help_string, #run, #show_help, #show_help_option

Constructor Details

This class inherits a constructor from Command

Instance Method Details

#create_argsObject



79
80
81
82
83
84
# File 'lib/clui_config.rb', line 79

def create_args
  add_cmd(ConfigInit, "init", "initialize in current directory")
  add_cmd(ConfigGet, "get", "print configuration parameter's value")
  add_cmd(ConfigDelete, "delete", "delete configuration parameter")
  add_cmd(ConfigSet, "set", "set (or reset) a configuration parameter to specified value")
end

#create_flowsObject



86
87
88
89
90
91
# File 'lib/clui_config.rb', line 86

def create_flows
  add_flow_from_usage("init")
  add_flow_from_usage("get")
  add_flow_from_usage("delete")
  add_flow_from_usage("set")
end

#execute(args, subargs) ⇒ Object



93
94
95
96
97
98
# File 'lib/clui_config.rb', line 93

def execute(args, subargs)
  command = args["command"]
  if command
    command.run(subargs)
  end
end