Class: OpscodeAcl::UserShow

Inherits:
Chef::Knife
  • Object
show all
Defined in:
lib/chef/knife/user_show.rb

Instance Method Summary collapse

Instance Method Details

#runObject



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

def run
  if name_args.length < 1
    show_usage
    ui.fatal "You must specify a username."
    exit 1
  end

  username = name_args[0]
  api_endpoint = "users/#{username}"
  user = rest.get_rest(api_endpoint)
  ui.output(ui.format_for_display(user))
end