Class: S7n::S7nCli::IntOption

Inherits:
Option
  • Object
show all
Defined in:
lib/s7n/s7ncli/option.rb

Instance Method Summary collapse

Methods inherited from Option

#arg_name, #initialize, #opt_name

Constructor Details

This class inherits a constructor from S7n::S7nCli::Option

Instance Method Details

#define(opts, config) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/s7n/s7ncli/option.rb', line 56

def define(opts, config)
  define_args = []
  if @short_name
    define_args << ("-" + @short_name)
  end
  define_args << ("--" + opt_name + "=" + arg_name)
  define_args << Integer
  define_args << @description
  opts.define(*define_args) do |arg|
    config[@name] = arg
  end
end