lib/cloudstack-cli/commands/account.rb in cloudstack-cli-0.12.3 vs lib/cloudstack-cli/commands/account.rb in cloudstack-cli-0.13.0

- old
+ new

@@ -20,18 +20,23 @@ end print_table table end end - desc 'list [NAME]', 'list accounts (by name)' - def list(name = nil) - accounts = client.list_accounts(name: name) + desc 'list', 'list accounts' + def list + accounts = client.list_accounts if accounts.size < 1 puts "No accounts found." else - table = [["Name", "Type", "Domain"]] + table = [%w(Name Type Domain State)] accounts.each do |account| - table << [account['name'], TYPES[account['accounttype']], account['domain']] + table << [ + account['name'], + TYPES[account['accounttype']], + account['domain'], + account['state'] + ] end print_table table say "Total number of accounts: #{accounts.size}" end end