class Fission::CLI

Public Class Methods

new(args=ARGV, parser=CommandLineParser) click to toggle source

Internal: Creates a new Fission::CLI object. This automatically parses the arguments in ARGV. This will also automatically display the usage and exit if applicable.

Examples

Fission::CLI.new

Returns a Fission::CLI object.

# File lib/fission/cli.rb, line 13
def initialize(args=ARGV, parser=CommandLineParser)
  @args = args ||= ARGV

  @parser = parser.new @args

  parse_arguments
end

Public Instance Methods

execute() click to toggle source

Internal: Execute the determined command.

Examples:

Fission::CLI.new(ARGV).execute

Returns nothing.

# File lib/fission/cli.rb, line 28
def execute
  @cmd.execute
end

Private Instance Methods

parse_arguments() click to toggle source

Internal: Parses the arguments using the parser.

Examples:

@cli.parse_arguments

Returns nothing.

# File lib/fission/cli.rb, line 40
def parse_arguments
  @parser.parse
  @cmd = @parser.command
end