Class: VPM::CommandOptions::AbstractCommandOptions
- Inherits:
-
Object
- Object
- VPM::CommandOptions::AbstractCommandOptions
- Defined in:
- lib/vpm/command_options/abstract_command_options.rb
Instance Attribute Summary collapse
-
#opts_parser ⇒ Object
readonly
Returns the value of attribute opts_parser.
Instance Method Summary collapse
Instance Attribute Details
#opts_parser ⇒ Object (readonly)
Returns the value of attribute opts_parser.
4 5 6 |
# File 'lib/vpm/command_options/abstract_command_options.rb', line 4 def opts_parser @opts_parser end |
Instance Method Details
#parse!(args) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/vpm/command_options/abstract_command_options.rb', line 6 def parse!(args) = {} parser().parse!(args) end |
#parser(options) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/vpm/command_options/abstract_command_options.rb', line 13 def parser() @opts_parser ||= OptionParser.new do |parser| define_parser(parser, ) parser.on_tail("-h", "--help", "Show help") do |v| puts parser exit end end end |