Class: Ing::OptionParsers::Trollop

Inherits:
Object
  • Object
show all
Defined in:
lib/ing/option_parsers/trollop.rb

Instance Method Summary collapse

Instance Method Details

#describeObject



19
20
21
22
23
# File 'lib/ing/option_parsers/trollop.rb', line 19

def describe
  s=StringIO.new
  parser.educate_banner s
  s.rewind; s.read      
end

#helpObject



25
26
27
28
29
# File 'lib/ing/option_parsers/trollop.rb', line 25

def help
  s=StringIO.new
  parser.educate s
  s.rewind; s.read      
end

#parse!(args) ⇒ Object



15
16
17
# File 'lib/ing/option_parsers/trollop.rb', line 15

def parse!(args)
  ::Trollop.with_standard_exception_handling(parser) { parser.parse(args) }
end

#parserObject



11
12
13
# File 'lib/ing/option_parsers/trollop.rb', line 11

def parser
  @parser ||= ::Trollop::Parser.new
end