Sha256: ef1954596dee370a7d7cb8317ea679540bc2231c5f8d6a6ab8f1b7328550fcf8

Contents?: true

Size: 817 Bytes

Versions: 91

Compression:

Stored size: 817 Bytes

Contents

require "cf/cli/organization/base"

module CF::Organization
  class Create < Base
    desc "Create an organization"
    group :organizations
    input :name, :desc => "Organization name", :argument => :optional
    input :target, :desc => "Switch to the organization after creation",
          :alias => "-t", :default => true
    input :add_self, :desc => "Add yourself to the organization",
          :default => true
    def create_org
      org = client.organization
      org.name = input[:name]
      org.users = [client.current_user] if input[:add_self]

      with_progress("Creating organization #{c(org.name, :name)}") do
        org.create!
      end

      if input[:target]
        invoke :target, :organization => org
      end
    end

    private

    def ask_name
      ask("Name")
    end
  end
end

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
cf-0.6.1.rc2 lib/cf/cli/organization/create.rb
cf-0.6.1.rc1 lib/cf/cli/organization/create.rb
cf-0.6.0 lib/cf/cli/organization/create.rb
cf-0.6.0.rc8 lib/cf/cli/organization/create.rb
cf-0.6.0.rc7 lib/cf/cli/organization/create.rb
cf-0.6.0.rc6 lib/cf/cli/organization/create.rb
cf-0.6.0.rc5 lib/cf/cli/organization/create.rb
cf-0.6.0.rc4 lib/cf/cli/organization/create.rb
cf-0.6.0.rc3 lib/cf/cli/organization/create.rb
cf-0.6.0.rc2 lib/cf/cli/organization/create.rb
cf-0.6.0.rc1 lib/cf/cli/organization/create.rb