lib/cloudstack-cli/commands/domain.rb in cloudstack-cli-0.0.5 vs lib/cloudstack-cli/commands/domain.rb in cloudstack-cli-0.1.0

- old
+ new

@@ -1,16 +1,17 @@ -class Domain < Thor +class Domain < CloudstackCli::Base - desc 'domain list [NAME]', 'list domains' + desc 'list [NAME]', 'list domains' def list(name = nil) - cs_cli = CloudstackCli::Helper.new(options[:config]) - domains = cs_cli.domains(name) + domains = client.list_domains(name) if domains.size < 1 puts "No domains found" else + table = [["Name", "Path"]] domains.each do |domain| - puts "#{domain['name']}" + table << [domain['name'], domain['path']] end + print_table table end end end \ No newline at end of file