Sha256: 3ae33c8fb33da04144d6edc2d87dc65282420b13861f1bb48768274fa25b9989

Contents?: true

Size: 626 Bytes

Versions: 1

Compression:

Stored size: 626 Bytes

Contents

# frozen_string_literal: true

require "optparse"
require "ostruct"

module Capwatch
  class CLI

    def self.parse(args)
      options = OpenStruct.new
      options.tick = 60
      opt_parser = OptionParser.new do |opts|
        opts.on("-t", "--tick [Integer]", Integer, "Tick Interval") do |t|
          options.tick = t
        end
        opts.on("-a", "--[no-]all", "Show All Cryptocurrencies") do |t|
          options.all = 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.2.5 lib/capwatch/cli.rb