Results for: "OptionParser"

No documentation available

Initializes the instance and yields itself if called with a block.

banner

Banner message.

width

Summary width.

indent

Summary indent.

Directs to reject specified class argument.

t

Argument class specifier, any object including Class.

reject(t)

See reject.

No documentation available

Pushes a new List.

Removes the last List.

Returns option summary string.

Checks if an argument is given twice, in which case an ArgumentError is raised. Called from OptionParser#switch only.

obj

New argument.

prv

Previously specified argument.

msg

Exception message.

No documentation available

Traverses @stack, sending each element method id with args and block.

Completes shortened long style option switch and returns pair of canonical switch and switch descriptor OptionParser::Switch.

typ

Searching table.

opt

Searching key.

icase

Search case insensitive if true.

pat

Optional pattern for completion.

No documentation available

Loads options from file names as filename. Does nothing when the file is not present. Returns whether successfully loaded.

filename defaults to basename of the program without suffix in a directory ~/.options.

Add option switch like with on, but at head of summary.

Add option switch like with on, but at tail of summary.

No documentation available

Sets OptionParser object, when opt is false or nil, methods OptionParser::Arguable#options and OptionParser::Arguable#options= are undefined. Thus, there is no ways to access the OptionParser object via the receiver object.

Actual OptionParser object, automatically created if nonexistent.

If called with a block, yields the OptionParser object and returns the result of the block. If an OptionParser::ParseError exception occurs in the block, it is rescued, a error message printed to STDERR and nil returned.

Parses self destructively and returns self containing the rest arguments left unparsed.

No documentation available

Searches key in id list. The result is returned or yielded if a block is given. If it isn’t found, nil is returned.

No documentation available

Substitution of getopts is possible as follows. Also see OptionParser#getopts.

def getopts(*args)
  ($OPT = ARGV.getopts(*args)).each do |opt, val|
    eval "$OPT_#{opt.gsub(/[^A-Za-z0-9_]/, '_')} = val"
  end
rescue OptionParser::ParseError
end

Produces the summary text. Each line of the summary is yielded to the block (without newline).

sdone

Already summarized short style options keyed hash.

ldone

Already summarized long style options keyed hash.

width

Width of left side (option part). In other words, the right side (description part) starts after width columns.

max

Maximum width of left side -> the options are filled within max columns.

indent

Prefix string indents all summarized lines.

Search took: 3ms  ·  Total Results: 4164