Sha256: a19a11e5b73524d7cd472ac521964bd471c7e9b594f848d13890dd9d60bee8f8

Contents?: true

Size: 487 Bytes

Versions: 1

Compression:

Stored size: 487 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
        opts.on('-e', '--telegram-token=', String) do |val|
          options.telegram = val
        end
      end
      opt_parser.parse!(args)
      options
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capwatch-0.1.13 lib/capwatch/cli.rb