class P4Tools::CommandOptions

Attributes

show_help[R]

Public Class Methods

new(parser) click to toggle source
# File lib/p4tools/parsers/command_options.rb, line 6
def initialize(parser)
  @parser = parser
  @show_help = true
end

Public Instance Methods

allow_empty_args() click to toggle source
# File lib/p4tools/parsers/command_options.rb, line 23
def allow_empty_args
  @show_help = false
end
arg(name, desc='', options={}) click to toggle source

@param [Symbol] name @param [String] desc @param [Hash<Symbol, Object>] options

# File lib/p4tools/parsers/command_options.rb, line 19
def arg(name, desc='', options={})
  @parser.opt(name, desc, options)
end
help(text) click to toggle source

@param [String] text

# File lib/p4tools/parsers/command_options.rb, line 12
def help(text)
  @parser.banner(text)
end
set(&opts) click to toggle source
# File lib/p4tools/parsers/command_options.rb, line 27
def set(&opts)
  self.instance_eval &opts
end