Class: CLI::Kit::Resolver
- Inherits:
-
Object
- Object
- CLI::Kit::Resolver
- Defined in:
- lib/cli/kit/resolver.rb
Instance Method Summary collapse
- #call(args) ⇒ Object
-
#initialize(tool_name:, command_registry:) ⇒ Resolver
constructor
: (tool_name: String, command_registry: CLI::Kit::CommandRegistry) -> void.
Constructor Details
#initialize(tool_name:, command_registry:) ⇒ Resolver
: (tool_name: String, command_registry: CLI::Kit::CommandRegistry) -> void
9 10 11 12 |
# File 'lib/cli/kit/resolver.rb', line 9 def initialize(tool_name:, command_registry:) @tool_name = tool_name @command_registry = command_registry end |
Instance Method Details
#call(args) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/cli/kit/resolver.rb', line 15 def call(args) args = args.dup command_name = args.shift command, resolved_name = @command_registry.lookup_command(command_name) if command.nil? command_not_found(command_name) raise CLI::Kit::AbortSilent # Already output message end [command, resolved_name, args] end |