Class: Capwatch::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/capwatch/cli.rb

Class Method Summary collapse

Class Method Details

.parse(args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/capwatch/cli.rb', line 6

def self.parse(args)
  options = OpenStruct.new
  options.tick = 60 * 5
  opt_parser = OptionParser.new do |opts|
    opts.on('-t', '--tick [Integer]', Integer, 'Tick Interval') do |t|
      options.tick = t
    end
  end
  opt_parser.parse!(args)
  options
end