Class Fission::CommandLineParser
In: lib/fission/command_line_parser.rb
Parent: Object

Methods

command   new   parse  

Public Class methods

Internal: Creates a new Fission::CommandLineParser object.

args - The command line arguments to parse. This is expected to be in the same format of ARGV (Array) (default: ARGV).

Examples:

  CommandLineParser.new ['foo', 'bar']

  CommandLineParser.new

Returns a Fission::CommandLineParser object.

Public Instance methods

Internal: Accessor for an instance of the determined command. This is set by running the parse method.

Examples:

  @command_line_parser.command

Returns an instance of the determined command if the arguments are valid. Returns nil if the parse command has not yet been run.

Internal: Parses the command line arguments. If the arguments are invalid, the appropriate help will be output and then will exit. If the arguments are valid, then the @command variable will be set to a new instance of the determined command class.

Examples:

  @command_line_parser.parse

Returns nothing.

[Validate]