class

SentenceOptions::Parser

Inherits Reference < Object

Constructors

new(banner : String)

Creates a new Parser with the specified banner

Source

Instance methods

add_command(command : Command)

Adds a Command to the list of commands. Note: Commands will be compared against arguments in the order added.

Source
commands
Source
parse(args)

parses the arguments (typically ARGV) passed to your app Returns: Bool - false if no Commands matched, or no arguments were passed. When a Command matches it returns the return value of its attempt to handle the args.

successful = my_parser.parse(ARGV)
STDERR.puts my_parser.banner unless successful
Source
usage

Retuns a usage string comprised of the baner and the description from all the Command objects that have been added. typically displayed when --help is called or when no arguments are passed

Source