Class: Ukiryu::Cli

Inherits:
Thor
  • Object
show all
Extended by:
FriendlyCLI
Defined in:
lib/ukiryu/cli.rb

Overview

CLI for exploring and interacting with Ukiryu tool profiles

Each command is implemented as a separate class in the CliCommands namespace. This file just delegates to those command classes, keeping each file under 200 lines.

Constant Summary

Constants included from FriendlyCLI

FriendlyCLI::HELP_OPTIONS, FriendlyCLI::MISSING_ARGS_PATTERN, FriendlyCLI::TRACE_ENV_VARS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from FriendlyCLI

extended, handle_argument_error, start

Class Method Details

.exit_on_failure?Boolean

Set default register path if not configured

Returns:

  • (Boolean)


19
20
21
# File 'lib/ukiryu/cli.rb', line 19

def self.exit_on_failure?
  false
end

Instance Method Details

#commands(tool_name) ⇒ Object



75
76
77
# File 'lib/ukiryu/cli.rb', line 75

def commands(tool_name)
  Ukiryu::CliCommands::CommandsCommand.new(options).run(tool_name)
end

#config(action = 'list', key = nil, value = nil) ⇒ Object



113
114
115
# File 'lib/ukiryu/cli.rb', line 113

def config(action = 'list', key = nil, value = nil)
  Ukiryu::CliCommands::ConfigCommand.new(options).run(action, key, value)
end

#describe(tool_name, command_name = nil) ⇒ Object



88
89
90
# File 'lib/ukiryu/cli.rb', line 88

def describe(tool_name, command_name = nil)
  Ukiryu::CliCommands::DescribeCommand.new(options).run(tool_name, command_name)
end

#exec(tool_name, command_name = nil, *params) ⇒ Object



51
52
53
# File 'lib/ukiryu/cli.rb', line 51

def exec(tool_name, command_name = nil, *params)
  Ukiryu::CliCommands::RunCommand.new(options).run(tool_name, command_name, *params)
end

#extract(tool_name) ⇒ Object



124
125
126
# File 'lib/ukiryu/cli.rb', line 124

def extract(tool_name)
  Ukiryu::CliCommands::ExtractCommand.new(options).run(tool_name)
end

#info(tool_name = nil) ⇒ Object



64
65
66
67
68
69
70
71
# File 'lib/ukiryu/cli.rb', line 64

def info(tool_name = nil)
  if tool_name.nil?
    # No tool specified - show help
    help
  else
    Ukiryu::CliCommands::InfoCommand.new(options).run(tool_name)
  end
end

#listObject



57
58
59
# File 'lib/ukiryu/cli.rb', line 57

def list
  Ukiryu::CliCommands::ListCommand.new(options).run
end

#opts(tool_name, command_name = nil) ⇒ Object



81
82
83
# File 'lib/ukiryu/cli.rb', line 81

def opts(tool_name, command_name = nil)
  Ukiryu::CliCommands::OptsCommand.new(options).run(tool_name, command_name)
end

#register(subcommand = nil) ⇒ Object



142
143
144
# File 'lib/ukiryu/cli.rb', line 142

def register(subcommand = nil)
  Ukiryu::CliCommands::RegisterCommand.new(options).run(subcommand, options)
end

#resolve(tool_name, version_constraint = nil) ⇒ Object



135
136
137
# File 'lib/ukiryu/cli.rb', line 135

def resolve(tool_name, version_constraint = nil)
  Ukiryu::CliCommands::ResolveCommand.new(options).run(tool_name, version_constraint)
end

#run_file(request_file) ⇒ Object



36
37
38
# File 'lib/ukiryu/cli.rb', line 36

def run_file(request_file)
  Ukiryu::CliCommands::RunFileCommand.new(options).run(request_file)
end

#system(subcommand = nil) ⇒ Object



94
95
96
# File 'lib/ukiryu/cli.rb', line 94

def system(subcommand = nil)
  Ukiryu::CliCommands::SystemCommand.new(options).run(subcommand)
end

#versionObject



99
100
101
# File 'lib/ukiryu/cli.rb', line 99

def version
  Ukiryu::CliCommands::VersionCommand.new(options).run
end

#which(identifier) ⇒ Object



107
108
109
# File 'lib/ukiryu/cli.rb', line 107

def which(identifier)
  Ukiryu::CliCommands::WhichCommand.new(options).run(identifier)
end