Module: Houki::Options

Defined in:
lib/houki/options.rb

Class Method Summary collapse

Class Method Details

.get_options(args) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/houki/options.rb', line 10

def get_options(args)
  options = {}

  parser = OptionParser.new do |opts|
    opts.banner = "Usage: houki [options]"

    opts.separator "Configuration files:"
    opts.on "-c", "--config-file FILE", "Use specified configuration file. Default is $HOME/.houki.yml" do |file|
      options[:config_file] = File.expand_path(file)
    end
  end

  parser.parse!(args)
  options
end

.parse!(args) ⇒ Object



6
7
8
# File 'lib/houki/options.rb', line 6

def parse!(args)
  get_options(args)
end