Class: Flare::Tools::Cli::SubCommand
Direct Known Subclasses
Activate, Balance, Deploy, Down, Dump, Dumpkey, Index, List, Master, Part, Ping, Reconstruct, Remove, Restore, Slave, Stats, Summary, Threads, Verify
Constant Summary
collapse
- S_OK =
0
- S_NG =
1
- @@myname =
{}
- @@desc =
{}
- @@usage =
{}
Util::Interruption::InterruptionTargets
Util::Constant::DefalutBwlimit, Util::Constant::DefaultIndexServerName, Util::Constant::DefaultIndexServerPort, Util::Constant::DefaultNodePort, Util::Constant::DefaultTimeout, Util::Constant::STATUS_NG, Util::Constant::STATUS_OK
Instance Attribute Summary
Attributes included from Option
#optp
Class Method Summary
collapse
Instance Method Summary
collapse
included, #initialize_interruption, #interrupt, #interrupt_, interrupt_all, #interrupted?, #interruptible, #interruptible?
#debug, #error, #fatal, #info, logger, #puts, set_logger, #trace, #warn
Methods included from Option
#option_init, #parse_options, #set_option_dry_run, #set_option_force, #set_option_global, #set_option_index_server
Constructor Details
Returns a new instance of SubCommand.
58
59
60
|
# File 'lib/flare/tools/cli/sub_command.rb', line 58
def initialize
option_init
end
|
Class Method Details
.desc(desc = nil) ⇒ Object
40
41
42
43
44
45
46
47
|
# File 'lib/flare/tools/cli/sub_command.rb', line 40
def self.desc(desc = nil)
if desc.nil?
@@desc[name] = "" unless @@desc.has_key?(name)
@@desc[name]
else
@@desc[name] = desc
end
end
|
.myname(myname = nil) ⇒ Object
27
28
29
|
# File 'lib/flare/tools/cli/sub_command.rb', line 27
def self.myname(myname = nil)
if myname.nil? then @@myname[name] else @@myname[name] = myname end
end
|
.to_s ⇒ Object
54
55
56
|
# File 'lib/flare/tools/cli/sub_command.rb', line 54
def self.to_s
self.to_sym.to_s
end
|
.to_sym ⇒ Object
23
24
25
|
# File 'lib/flare/tools/cli/sub_command.rb', line 23
def self.to_sym
myname
end
|
.usage(usage = nil) ⇒ Object
31
32
33
34
35
36
37
38
|
# File 'lib/flare/tools/cli/sub_command.rb', line 31
def self.usage(usage = nil)
if usage.nil?
@@usage[name] = "" unless @@usage.has_key?(name)
@@usage[name]
else
@@usage[name] = usage
end
end
|
Instance Method Details
#execute ⇒ Object
73
74
75
|
# File 'lib/flare/tools/cli/sub_command.rb', line 73
def execute
raise "execute"
end
|
#execute_subcommand(config, args) ⇒ Object
66
67
68
69
70
71
|
# File 'lib/flare/tools/cli/sub_command.rb', line 66
def execute_subcommand(config, args)
setup
rest_args = parse_options(config, args)
execute(config, rest_args)
end
|
#myname ⇒ Object
49
50
51
52
|
# File 'lib/flare/tools/cli/sub_command.rb', line 49
def myname
myname = @@myname[self.class.name]
if myname.nil? then "" else myname end
end
|
#setup ⇒ Object
62
63
64
|
# File 'lib/flare/tools/cli/sub_command.rb', line 62
def setup
set_option_global
end
|