Method: Chore::CLI#parse

Defined in:
lib/chore/cli.rb

#parse(args = ARGV) ⇒ Object

:nodoc:



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/chore/cli.rb', line 72

def parse(args=ARGV) #:nodoc:
  Chore.configuring = true
  setup_options

  # parse once to load the config file & require options
  # any invalid options are ignored the first time around since booting the
  # system may register additional options from 3rd-party libs
  parse_opts(args, true)
  parse_config_file(@options[:config_file], true) if @options[:config_file]

  validate!
  boot_system

  # parse again to pick up options required by loaded classes
  # any invalid options will raise an exception this time
  parse_opts(args)
  parse_config_file(@options[:config_file]) if @options[:config_file]
  detect_queues
  Chore.configure(options)
  Chore.configuring = false
  validate_strategy!
end