lib/brightbox-cli/commands/users-show.rb in brightbox-cli-0.18.1 vs lib/brightbox-cli/commands/users-show.rb in brightbox-cli-1.0.0.rc1
- old
+ new
@@ -1,25 +1,28 @@
module Brightbox
- desc 'Show detailed user info'
- arg_name 'user-id...'
- command [:show] do |c|
+ command [:users] do |cmd|
- c.action do |global_options,options,args|
+ cmd.desc "Show detailed user info"
+ cmd.arg_name "user-id..."
+ cmd.command [:show] do |c|
- if args.empty?
- raise "You must specify the users you want to show"
- end
+ c.action do |global_options, options, args|
- users = User.find_or_call(args) do |id|
- warn "Couldn't find user #{id}"
- end
+ if args.empty?
+ raise "You must specify the users you want to show"
+ end
- table_opts = global_options.merge({
- :vertical => true,
- :fields => [:id, :name, :email_address, :accounts, :ssh_key ]
- })
+ users = User.find_or_call(args) do |id|
+ warn "Couldn't find user #{id}"
+ end
- render_table(users, table_opts)
+ table_opts = global_options.merge({
+ :vertical => true,
+ :fields => [:id, :name, :email_address, :accounts, :ssh_key ]
+ })
+ render_table(users, table_opts)
+
+ end
end
end
end