Class: Kitchen::Command::List
Overview
Command to list one or more instances.
Instance Method Summary collapse
-
#call ⇒ Object
Invoke the command.
Methods inherited from Base
Methods included from Logging
#banner, #debug, #error, #fatal, #info, #warn
Constructor Details
This class inherits a constructor from Kitchen::Command::Base
Instance Method Details
#call ⇒ Object
Invoke the command.
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/kitchen/command/list.rb', line 28 def call result = parse_subcommand(args.first) if [:debug] die "The --debug flag on the list subcommand is deprecated, " \ "please use `kitchen diagnose'." elsif [:bare] puts Array(result).map(&:name).join("\n") elsif [:json] puts JSON.pretty_generate(Array(result).map { |r| to_hash(r) }) else list_table(result) end end |