Class: S7::S7Cli::BoolOption

Inherits:
Option
  • Object
show all
Defined in:
lib/s7/s7cli/option.rb

Instance Method Summary collapse

Methods inherited from Option

#arg_name, #initialize, #opt_name

Methods included from GetText

#N_, #_, bindtextdomain, included

Constructor Details

This class inherits a constructor from S7::S7Cli::Option

Instance Method Details

#define(opts, config) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/s7/s7cli/option.rb', line 42

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