Class: Optplus::NestedParser

Inherits:
Parser
  • Object
show all
Defined in:
lib/optplus/nested.rb

Overview

define a nested parser to add sub-actions to an action

Useful if you want to group actions together. For example, if you have a command that does things for services (for example) and other things for servers (for example) then you can define a nested parser for each and then define actions ‘services’ and ‘servers’ that use these parsers:

my_command servers list --all
my_command services list --all

Optplus does not allow option switches to be specific to any one action - its an everything and everywhere approach.

Note that NestedParser inherits everything from Parser and could therefore nest another parser within itself, ad infinitum. You could also define methods such as #options which would be a waste because they would never be called.

Instance Attribute Summary

Attributes inherited from Parser

#program_name

Method Summary

Methods inherited from Parser

#all_options, #debug_option, describe, description, #exit_on_error, help, #man, nest_parser, #set_option, usage, #verbose_option