Class: Ukiryu::Cli
- Inherits:
-
Thor
- Object
- Thor
- Ukiryu::Cli
- 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
-
.exit_on_failure? ⇒ Boolean
Set default register path if not configured.
Instance Method Summary collapse
- #commands(tool_name) ⇒ Object
- #config(action = 'list', key = nil, value = nil) ⇒ Object
- #describe(tool_name, command_name = nil) ⇒ Object
- #exec(tool_name, command_name = nil, *params) ⇒ Object
- #extract(tool_name) ⇒ Object
- #info(tool_name = nil) ⇒ Object
- #list ⇒ Object
- #opts(tool_name, command_name = nil) ⇒ Object
- #register(subcommand = nil) ⇒ Object
- #resolve(tool_name, version_constraint = nil) ⇒ Object
- #run_file(request_file) ⇒ Object
- #system(subcommand = nil) ⇒ Object
- #version ⇒ Object
- #which(identifier) ⇒ Object
Methods included from FriendlyCLI
extended, handle_argument_error, start
Class Method Details
.exit_on_failure? ⇒ Boolean
Set default register path if not configured
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().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().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().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().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().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().run(tool_name) end end |
#list ⇒ Object
57 58 59 |
# File 'lib/ukiryu/cli.rb', line 57 def list Ukiryu::CliCommands::ListCommand.new().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().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().run(subcommand, ) 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().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().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().run(subcommand) end |
#version ⇒ Object
99 100 101 |
# File 'lib/ukiryu/cli.rb', line 99 def version Ukiryu::CliCommands::VersionCommand.new().run end |
#which(identifier) ⇒ Object
107 108 109 |
# File 'lib/ukiryu/cli.rb', line 107 def which(identifier) Ukiryu::CliCommands::WhichCommand.new().run(identifier) end |