define_tail

define_tail(*opts, &block) Instance Public methods Also aliased as: def_tail_option

environment

environment(env = File.basename($0, '.*')) Instance Public methods Parses environment variable env or its uppercase with splitting like a shell. env defaults to the basename of the program.

getopts 2

getopts(*args) Instance Public methods Wrapper method for getopts.rb. params = ARGV.getopts("ab:", "foo", "bar:") # params[:a] = true # -a # params[:b] = "1" # -b1 # params[:foo] = "1" # --foo # params[:bar] = "x" # --bar x

help

help() Instance Public methods Returns option summary string. to_s

inc 2

inc(*args) Instance Public methods

load

load(filename = nil) Instance Public methods 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.

make_switch

make_switch(opts, block = nil) Instance Public methods Creates an OptionParser::Switch from the parameters. The parsed argument value is passed to the given block, where it can be processed. See at the beginning of OptionParser for some full examples. opts can include the following elements: Argument style: One of the following: :NONE, :REQUIRED, :OPTIONAL Argument pattern: Acceptable option argument format, must be pre-defined with #accept or #accept, or Regexp. This can app

new 2

new() Instance Public methods Pushes a new List.

on

on(*opts, &block) Instance Public methods Add option switch and handler. See make_switch for an explanation of parameters.

on_head

on_head(*opts, &block) Instance Public methods Add option switch like with on, but at head of summary.