Sha256: f7165c686ebb1fa593b99405e60db4f3e3b98b077f9bd5f4eda5d2ec6e2df42a

Contents?: true

Size: 382 Bytes

Versions: 2

Compression:

Stored size: 382 Bytes

Contents

require 'optparse'
require 'ostruct'

module Capwatch
  class CLI
    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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capwatch-0.1.12 lib/capwatch/cli.rb
capwatch-0.1.11 lib/capwatch/cli.rb