Class | Trollop::Parser |
In: |
lib/trollop.rb
|
Parent: | Object |
FLAG_TYPES | = | [:flag, :bool, :boolean] | The set of values that indicate a flag type of option when one of the values is given to the :type parameter to opt. | |
SINGLE_ARG_TYPES | = | [:int, :integer, :string, :double, :float] | The set of values that indicate an option that takes a single parameter when one of the values is given to the :type parameter to opt. | |
MULTI_ARG_TYPES | = | [:ints, :integers, :strings, :doubles, :floats] | The set of values that indicate an option that takes multiple parameters when one of the values is given to the :type parameter to opt. | |
TYPES | = | FLAG_TYPES + SINGLE_ARG_TYPES + MULTI_ARG_TYPES | The set of values specifiable as the :type parameter to opt. |
leftovers | [R] | The values from the commandline that were not interpreted by parse. |
specs | [R] | The complete configuration hashes for each option. (Mainly useful for testing.) |
Marks two (or more!) options as requiring each other. Only handles undirected (i.e., mutual) dependencies. Directed dependencies are better modeled with Trollop::die.
Add an option. ‘name’ is the argument name, a unique identifier for the option that you will use internally. ‘desc’ a string description which will be displayed in help messages. Takes the following optional arguments:
Defines a set of words which cause parsing to terminate when encountered, such that any options to the left of the word are parsed as usual, and options to the right of the word are left intact.
A typical use case would be for subcommand support, where these would be set to the list of subcommands. A subsequent Trollop invocation would then be used to parse subcommand options.
Similar to stop_on, but stops on any unknown word when encountered (unless it is a parameter for an argument).