Module: EY::Config

Defined in:
lib/ey_config.rb

Instance Method Summary collapse

Instance Method Details

#setup_common_options(opts, options) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ey_config.rb', line 4

def setup_common_options(opts, options)
  opts.on("-u", "--user USER", "Specify the rabbitmq username.") do |user|
    options[:user] = user
  end
  
  opts.on("-h", "--host HOST", "Specify the rabbitmq hostname.") do |host|
    options[:host] = host
  end
  
  opts.on("-P", "--port PORT", "Specify the rabbitmq PORT, default 5672.") do |port|
    options[:port] = port
  end
  
  opts.on("-p", "--pass PASSWORD", "Specify the rabbitmq password") do |pass|
    options[:pass] = pass
  end
  
  opts.on("-v", "--vhost VHOST", "Specify the rabbitmq vhost") do |vhost|
    options[:vhost] = vhost
  end
  
  opts.on("-d", "--daemonize", "Run #{type} as a daemon") do |d|
    options[:daemonize] = true
  end
  
  opts.on("--pid-dir PATH", "Specify the pid path, only used with daemonize") do |dir|
    options[:pid_dir] = dir
  end
  
  opts.on("-l", "--log-level LEVEL", "Specify the log level (fatal, error, warn, info, debug). Default is info") do |level|
    options[:log_level] = level
  end
  
  opts.on("--log-dir PATH", "Specify the log path") do |dir|
    options[:log_dir] = dir
  end
end