Class: Fission::CLI

Inherits:
Object show all
Defined in:
lib/fission/cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(args = ARGV, parser = CommandLineParser) ⇒ CLI

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.



13
14
15
16
17
18
19
# File 'lib/fission/cli.rb', line 13

def initialize(args=ARGV, parser=CommandLineParser)
  @args = args ||= ARGV

  @parser = parser.new @args

  parse_arguments
end

Instance Method Details

#executeObject

Internal: Execute the determined command.

Examples:

Fission::CLI.new(ARGV).execute

Returns nothing.



28
29
30
# File 'lib/fission/cli.rb', line 28

def execute
  @cmd.execute
end