Module: Kitchen::CLI::PerformCommand
- Included in:
- Kitchen::CLI
- Defined in:
- lib/kitchen/cli.rb
Overview
Common module to load and invoke a CLI-implementation agnostic command.
Instance Method Summary collapse
-
#perform(task, command, args = nil, additional_options = {}) ⇒ Object
Perform a CLI subcommand.
Instance Method Details
#perform(task, command, args = nil, additional_options = {}) ⇒ Object
Perform a CLI subcommand.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/kitchen/cli.rb', line 40 def perform(task, command, args = nil, = {}) require "kitchen/command/#{command}" = { action: task, help: -> { help(task) }, config: @config, shell:, }.merge() str_const = Thor::Util.camel_case(command) klass = ::Kitchen::Command.const_get(str_const) klass.new(args, , ).call end |