Class: Chef::Knife::NodeShow

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

Instance Method Summary collapse

Methods included from Core::MultiAttributeReturnOption

included

Methods included from Core::FormattingOptions

included

Instance Method Details

#runObject



48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/chef/knife/node_show.rb', line 48

def run
  ui.use_presenter Knife::Core::NodePresenter
  @node_name = @name_args[0]

  if @node_name.nil?
    show_usage
    ui.fatal("You must specify a node name")
    exit 1
  end

  node = Chef::Node.load(@node_name)
  output(format_for_display(node))
end