Sha256: 83f3d8a3507891a89f911b51931fdfd1be437cb0fadda97f1128441ee805c4ad

Contents?: true

Size: 1.06 KB

Versions: 24

Compression:

Stored size: 1.06 KB

Contents

require "vmc/cli/organization/base"

module VMC::Organization
  class Org < Base
    desc "Show organization information"
    group :organizations
    input :organization, :desc => "Organization to show",
          :aliases => %w{--org -o}, :argument => :optional,
          :from_given => by_name(:organization),
          :default => proc { client.current_organization }
    input :full, :desc => "Show full information for spaces, domains, etc.",
          :default => false
    def org
      org = input[:organization]

      unless org
        return if quiet?
        fail "No current organization."
      end

      if quiet?
        puts org.name
        return
      end

      line "#{c(org.name, :name)}:"

      indented do
        line "domains: #{name_list(org.domains)}"

        if input[:full]
          line "spaces:"

          spaced(org.spaces(:depth => 2)) do |s|
            indented do
              invoke :space, :space => s
            end
          end
        else
          line "spaces: #{name_list(org.spaces)}"
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
vmc-0.5.1 lib/vmc/cli/organization/org.rb
static-1.0.3 vendor/vmc-0.5.0/lib/vmc/cli/organization/org.rb
vmc-0.5.1.rc6 lib/vmc/cli/organization/org.rb
static-1.0.1 vendor/vmc-0.5.0/lib/vmc/cli/organization/org.rb
vmc-0.5.1.rc5 lib/vmc/cli/organization/org.rb
vmc-0.5.1.rc4 lib/vmc/cli/organization/org.rb
vmc-0.5.1.rc3 lib/vmc/cli/organization/org.rb
vmc-0.5.1.rc2 lib/vmc/cli/organization/org.rb
vmc-0.5.1.rc1 lib/vmc/cli/organization/org.rb
vmc-0.5.0 lib/vmc/cli/organization/org.rb
vmc-0.5.0.rc4 lib/vmc/cli/organization/org.rb
vmc-0.5.0.rc3 lib/vmc/cli/organization/org.rb
vmc-0.5.0.rc2 lib/vmc/cli/organization/org.rb
vmc-0.5.0.rc1 lib/vmc/cli/organization/org.rb
vmc-0.5.0.beta.12 lib/vmc/cli/organization/org.rb
vmc-0.5.0.beta.11 lib/vmc/cli/organization/org.rb
vmc-0.5.0.beta.10 lib/vmc/cli/organization/org.rb
vmc-0.5.0.beta.7 lib/vmc/cli/organization/org.rb
vmc-0.5.0.beta.6 lib/vmc/cli/organization/org.rb
vmc-0.5.0.beta.5 lib/vmc/cli/organization/org.rb