Module: Commando

Defined in:
lib/commando.rb,
lib/commando/config.rb,
lib/commando/runner.rb,
lib/commando/version.rb,
lib/commando/io_handler.rb,
lib/commando/action/help.rb,
lib/commando/action/quit.rb,
lib/commando/interpreter.rb,
lib/commando/action/history.rb,
lib/commando/quit_exception.rb

Overview

Entry point for the Command Line Interface (CLI).

Present the user with a text-based interface, where a prompt is printed, then commands are read from stardard in, then executed. This process is repeated indefinitely until the user give either the “quit” command, or presses <CMD>+D.

Defined Under Namespace

Modules: Action Classes: Runner

Constant Summary collapse

VERSION =
'2.0.0'

Class Method Summary collapse

Class Method Details

.start {|config| ... } ⇒ Object

Begin the prompt, get input, process loop.

Yields:

  • (config)


12
13
14
15
16
# File 'lib/commando.rb', line 12

def self.start(&block)
  config = Config.new
  yield config if block_given?
  Runner.new(config: config).start
end