Searches key
in @stack for id
hash and returns or yields the result.
Terminates option parsing. Optional parameter arg
is a string pushed back to be the first non-option argument.
Directs to accept specified class t
. The argument string is passed to the block in which it should be converted to the desired class.
t
Argument class specifier, any object including Class
.
pat
Pattern for argument, defaults to t
if it responds to match.
accept(t, pat, &block)
Heading banner preceding summary.
Release code
Returns version string from program_name
, version and release.
Subject of on_tail
.
Puts option summary into to
and returns to
. Yields each line if a block is given.
to
Output destination, which must have method <<. Defaults to [].
width
Width of left side, defaults to @summary_width.
max
Maximum length allowed for left side, defaults to width
- 1.
indent
Indentation, defaults to @summary_indent.
Add option switch and handler. See make_switch
for an explanation of parameters.
Parses command line arguments argv
in order. When a block is given, each non-option argument is yielded.
Returns the rest of argv
left unparsed.
Same as order
, but removes switches destructively. Non-option arguments remain in argv
.
Parses command line arguments argv
in permutation mode and returns list of non-option arguments.
Same as permute
, but removes switches destructively. Non-option arguments remain in argv
.
Parses environment variable env
or its uppercase with splitting like a shell.
env
defaults to the basename of the program.
Initializes a new instance and evaluates the optional block in context of the instance. Arguments args
are passed to new
, see there for description of parameters.
This method is deprecated, its behavior corresponds to the older new
method.
Returns an incremented value of default
according to arg
.