Class: Chef::Knife::EnvironmentShow

Inherits:
Knife
  • Object
show all
Includes:
Core::MultiAttributeReturnOption
Defined in:
lib/chef/knife/environment_show.rb

Instance Method Summary collapse

Methods included from Core::MultiAttributeReturnOption

included

Instance Method Details

#runObject



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/chef/knife/environment_show.rb', line 33

def run
  env_name = @name_args[0]

  if env_name.nil?
    show_usage
    ui.fatal("You must specify an environment name")
    exit 1
  end

  env = Chef::Environment.load(env_name)
  output(format_for_display(env))
end