lib/koma/cli.rb in koma-0.6.0 vs lib/koma/cli.rb in koma-0.7.0
- old
+ new
@@ -22,10 +22,15 @@
option :port,
type: :numeric,
banner: '<port>',
desc: 'port',
aliases: :p
+ Koma::HostInventory.disabled_keys.each do |key|
+ option "with-#{key}",
+ type: :boolean,
+ desc: "enable #{key}"
+ end
def ssh(host)
backend = Koma::Backend::Ssh.new(host, options)
if options[:yaml]
puts YAML.dump(backend.gather)
else
@@ -41,10 +46,15 @@
aliases: :k
option :yaml,
type: :boolean,
desc: 'stdout YAML',
aliases: :y
+ Koma::HostInventory.disabled_keys.each do |key|
+ option "with-#{key}",
+ type: :boolean,
+ desc: "enable #{key}"
+ end
def exec
backend = Koma::Backend::Exec.new(nil, options)
if options[:yaml]
puts YAML.dump(backend.gather)
else
@@ -52,10 +62,11 @@
end
end
desc 'keys', 'host inventory keys'
def keys
- Specinfra::HostInventory.inventory_keys.each do |key|
+ Koma::HostInventory.all_inventory_keys.each do |key|
+ key += ' (disabled)' if Koma::HostInventory.disabled_keys.include?(key)
puts key
end
end
end
end