Sha256: 9f9905172844fc36bdc1337b50f42668bfea5c1ad1d68f83233bd4fc705340aa

Contents?: true

Size: 650 Bytes

Versions: 3

Compression:

Stored size: 650 Bytes

Contents

class Ey::Core::Cli::Environments < Ey::Core::Cli::Subcommand
  title "environments"
  summary "Retrieve a list of Engine Yard environments that you have access to."
  option :account, short: 'c', long: 'account', description: 'Filter by account name or id', argument: 'Account'

  def handle
    environments = if option(:account)
                     core_account_for(options).environments.all
                   else
                     current_accounts.map(&:environments).flatten.sort_by(&:id)
                   end


    table_data = TablePrint::Printer.new(environments, [{id: {width: 10}}, :name])
    puts table_data.table_print
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ey-core-3.1.2 lib/ey-core/cli/environments.rb
ey-core-3.1.1 lib/ey-core/cli/environments.rb
ey-core-3.1.0 lib/ey-core/cli/environments.rb