Sha256: dd5f33130c9bdb4530ebbb0a8d53fa25eb7b2c85280acb922b8174a67d1ec6d9
Contents?: true
Size: 1.32 KB
Versions: 1
Compression:
Stored size: 1.32 KB
Contents
require "vmc/cli" module VMC class Organization < CLI def precondition super fail "This command is v2-only." unless v2? end def self.by_name(what, obj = what) proc { |name, *_| client.send(:"#{obj}_by_name", name) || fail("Unknown #{what} '#{name}'") } end desc "Show organization information" group :organizations input(:organization, :aliases => ["--org", "-o"], :argument => :optional, :from_given => by_name("organization"), :desc => "Organization to show") { client.current_organization } input :full, :type => :boolean, :desc => "Show full information for appspaces" def org(input) org = input[:organization] 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(2)) do |s| indented do invoke :space, :space => s end end else line "spaces: #{name_list(org.spaces)}" end end end private def name_list(xs) if xs.empty? d("none") else xs.collect { |x| c(x.name, :name) }.join(", ") end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vmc-0.4.0.beta.26 | vmc-ng/lib/vmc/cli/organization.rb |