lib/acquia_toolbelt/cli/domain.rb in acquia_toolbelt-2.3.2 vs lib/acquia_toolbelt/cli/domain.rb in acquia_toolbelt-2.4.0

- old
+ new

@@ -41,19 +41,25 @@ environments << options[:environment] else environments = AcquiaToolbelt::CLI::API.environments end + ui.say + + rows = [] + headings = ['Domain'] + environments.each do |environment| domains = AcquiaToolbelt::CLI::API.request "sites/#{subscription}/envs/#{environment}/domains" - ui.say - ui.say "Environment: #{environment}" unless options[:environment] - domains.each do |domain| - ui.say "> #{domain['name']}" + row_data = [] + row_data << domain['name'] + rows << row_data end end + + ui.output_table('', headings, rows) end # Public: Add a domain to the subscription. # # Returns a status message. @@ -108,10 +114,10 @@ end # Public: Purge a domains web cache. # # Returns a status message. - desc 'purge', 'Purge a domain\'s web cache.' + desc 'purge', "Purge a domain's web cache." method_option :domain, :type => :string, :aliases => %w(-d), :desc => 'URL of the domain to purge.' def purge if options[:subscription] subscription = options[:subscription]