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-5.0.0.rc3 lib/cf/cli/organization/create.rb
cf-5.0.0.rc1 lib/cf/cli/organization/create.rb
cf-4.2.9.rc5 lib/cf/cli/organization/create.rb
cf-4.2.9.rc3 lib/cf/cli/organization/create.rb
cf-4.2.10.rc2 lib/cf/cli/organization/create.rb
cf-4.2.10.rc1 lib/cf/cli/organization/create.rb
cf-4.2.9.rc2 lib/cf/cli/organization/create.rb
cf-4.2.8 lib/cf/cli/organization/create.rb
cf-4.2.8.rc2 lib/cf/cli/organization/create.rb
cf-4.2.8.rc1 lib/cf/cli/organization/create.rb
cf-4.2.7 lib/cf/cli/organization/create.rb
cf-4.2.6 lib/cf/cli/organization/create.rb
cf-4.2.5 lib/cf/cli/organization/create.rb
cf-4.2.4 lib/cf/cli/organization/create.rb
cf-4.2.3 lib/cf/cli/organization/create.rb
cf-4.2.2.rc3 lib/cf/cli/organization/create.rb
cf-4.2.2.rc2 lib/cf/cli/organization/create.rb
cf-4.2.2.rc1 lib/cf/cli/organization/create.rb
cf-4.2.1 lib/cf/cli/organization/create.rb
cf-4.2.1.rc3 lib/cf/cli/organization/create.rb