Class: DRbQS::Command::Node

Inherits:
Base
  • Object
show all
Defined in:
lib/drbqs/command_line/command_node.rb

Constant Summary collapse

HELP_MESSAGE =
<<HELP
Usage: #{@@command_name} <uri> [options ...]
  Start DRbQS nodes connecting to <uri>.

HELP

Constants included from Misc

Misc::STRINGS_FOR_KEY

Instance Method Summary collapse

Methods inherited from Base

exec, #exec, #setting

Methods included from Argument

check_argument_size, split_arguments

Methods included from Misc

create_logger, create_uri, output_error, process_running_normally?, random_key, time_to_history_string, time_to_history_string2, uri_drbunix

Constructor Details

#initializeNode

Returns a new instance of Node.



10
11
12
# File 'lib/drbqs/command_line/command_node.rb', line 10

def initialize
  super(DRbQS::Setting::Node, HELP_MESSAGE)
end

Instance Method Details

#parse_option(argv) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/drbqs/command_line/command_node.rb', line 14

def parse_option(argv)
  argv = option_parser_base(argv, :log_level => true, :daemon => true, :debug => true) do
    set(:load, '-l', '--load FILE', String, 'Add a file to load.')
    set(:process, '-P', '--process NUM', Integer, 'Set the number of node processes to execute.')
    set(:group, '--group STR', String, 'Set the group of node.')
    set(:loadavg, '--loadavg STR', String, 'Set the threshold load average to sleep.')
    set(:log_prefix, '--log-prefix STR', String, "Set the prefix of log files. The default is '#{setting.default[:log_prefix][0]}'.")
    set(:log_stdout, '--log-stdout', 'Use stdout for outputting logs. This option cancels --log-prefix.')
  end
  setting.set_argument(*argv)
end