Module: RailsGraph::Helpers::OptionsParser

Defined in:
lib/rails_graph/helpers/options_parser.rb

Instance Method Summary collapse

Instance Method Details

#parse_options(banner, arguments) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rails_graph/helpers/options_parser.rb', line 8

def parse_options(banner, arguments)
  parser = OptionParser.new
  parser.banner = banner
  options = {}

  arguments.each { |argument| parser.on(*argument) }

  parser.parse!(parser.order!(ARGV), into: options)

  options
end