Method: Pablo#initialize
- Defined in:
- lib/pablo.rb
#initialize(opts = Hash.new) ⇒ Pablo
-
opts: options for Pablo-
:command_consumes_all => true|false Forces toplevel commands (not) to consume all arguments after being applied. I’m still looking for a better name for that option, so it may be subject to change.
-
:expand => true|false|Array Turns on the automatic abbreviation expansion mechanism for
-
all parsers (true)
-
no parsers (false)
-
a specific parser (Array containing :commands and/or :options)
-
-
:program => String The name of the Program to be displayed by
helpandversion. -
:version => String The version of the Program to be displayed by
versionandhelp. -
:usage => String The usage information of the Program to be displayed by
help, e.g.[<command>] [<>]
-
85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/pablo.rb', line 85 def initialize opts = Hash.new @opts = { :command_consumes_all => true, :expand => false }.merge(opts) () @finalize = @colorize = @cur = nil @toplevel, @args, @pending = true, nil, Hash.new , @ambiguity, @registered = Array.new, nil, Array.new , @commands, @tokens = Hash.new, Hash.new, Hash.new end |