Class: Fission::CLI
Instance Method Summary collapse
-
#execute ⇒ Object
Internal: Execute the determined command.
-
#initialize(args = ARGV, parser = CommandLineParser) ⇒ CLI
constructor
Internal: Creates a new Fission::CLI object.
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
#execute ⇒ Object
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 |