Sha256: 0481294be367c0267495e743f5ddc583c37b0bf180dcd8c044a5ef48f88ac763

Contents?: true

Size: 520 Bytes

Versions: 3

Compression:

Stored size: 520 Bytes

Contents

# frozen_string_literal: true

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

3 entries across 3 versions & 1 rubygems

Version Path
capwatch-0.2.4 lib/capwatch/cli.rb
capwatch-0.2.3 lib/capwatch/cli.rb
capwatch-0.2.0 lib/capwatch/cli.rb