Class: Tomo::CLI

Inherits:
Object
  • Object
show all
Extended by:
Testing::CLIExtensions
Defined in:
lib/tomo/cli.rb,
lib/tomo/cli/error.rb,
lib/tomo/cli/rules.rb,
lib/tomo/cli/state.rb,
lib/tomo/cli/usage.rb,
lib/tomo/cli/parser.rb,
lib/tomo/cli/command.rb,
lib/tomo/cli/options.rb,
lib/tomo/cli/completions.rb,
lib/tomo/cli/common_options.rb,
lib/tomo/cli/deploy_options.rb,
lib/tomo/cli/project_options.rb,
lib/tomo/cli/rules_evaluator.rb,
lib/tomo/cli/interrupted_error.rb

Defined Under Namespace

Modules: CommonOptions, DeployOptions, ProjectOptions Classes: Command, Completions, Error, InterruptedError, Options, Parser, Rules, RulesEvaluator, State, Usage

Constant Summary collapse

COMMANDS =
{
  "deploy" => Tomo::Commands::Deploy,
  "help" => Tomo::Commands::Help,
  "init" => Tomo::Commands::Init,
  "run" => Tomo::Commands::Run,
  "setup" => Tomo::Commands::Setup,
  "tasks" => Tomo::Commands::Tasks,
  "version" => Tomo::Commands::Version,
  "completion-script" => Tomo::Commands::CompletionScript
}.freeze
COMMAND_ALIASES =
{
  "-T" => Tomo::Commands::Tasks
}.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Testing::CLIExtensions

exit

Class Attribute Details

.show_backtraceObject

Returns the value of attribute show_backtrace.



21
22
23
# File 'lib/tomo/cli.rb', line 21

def show_backtrace
  @show_backtrace
end

Class Method Details

.exit(status = true) ⇒ Object

rubocop:disable Style/OptionalBooleanParameter



23
24
25
# File 'lib/tomo/cli.rb', line 23

def exit(status=true) # rubocop:disable Style/OptionalBooleanParameter
  Process.exit(status)
end

Instance Method Details

#call(argv) ⇒ Object



43
44
45
46
47
48
49
50
51
# File 'lib/tomo/cli.rb', line 43

def call(argv)
  prepare_completions(argv)
  command, command_name = lookup_command(argv)
  command.parse(argv)
rescue Interrupt
  handle_error(InterruptedError.new, command_name)
rescue StandardError, SyntaxError => e
  handle_error(e, command_name)
end