Class: Sr71::CLI::Options
- Inherits:
-
Object
- Object
- Sr71::CLI::Options
- Defined in:
- lib/sr71/cli.rb
Instance Method Summary collapse
Instance Method Details
#parse!(args) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/sr71/cli.rb', line 6 def parse!(args) args, = args.dup, {} [:sr71_config] = '/etc/sr71.yml' opt_parser = OptionParser.new do |opts| opts. = "Usage: sr71 [options]" opts.on("-c", "--config=file", String, "SR71 configuration file") { |v| [:sr71_config] = v } opts.separator "" opts.on("-h", "--help", "Show this help message.") { puts opts; exit } end opt_parser.parse! args end |