Method: Quebert::CommandLineRunner#parser

Defined in:
lib/quebert/command_line_runner.rb

#parserObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/quebert/command_line_runner.rb', line 19

def parser
  @parser ||= OptionParser.new do |opts|
    opts.banner = "Usage: quebert [options]"

    opts.separator ""

    opts.on("-l", "--log FILE", "File to redirect output " +
                                "(default: #{@options[:log]})")                   { |file| @options[:log] = file }
    opts.on("-P", "--pid FILE", "File to store PID " +
                                "(default: #{@options[:pid]})")                   { |file| @options[:pid] = file }
    opts.on("-C", "--config FILE", "Load options from config file")               { |file| @options[:config] = file }
    opts.on("-c", "--chdir DIR", "Change to dir before starting")                 { |dir| @options[:chdir] = File.expand_path(dir) }
    opts.on("-q", "--queues LIST", "Specify queue name(s)")                       { |list| @options[:queues] = list.split(",") }
  end
end