Sha256: 627cc75896666d9290f3a928005bdd44fc38e8f19b214e503a38cf9ea6ed8409

Contents?: true

Size: 777 Bytes

Versions: 7

Compression:

Stored size: 777 Bytes

Contents

require "vmc/cli/domain/base"

module VMC::Domain
  class RemoveDomain < Base
    desc "Remove a domain from a space"
    group :domains
    input :domain, :desc => "Domain to add", :argument => :optional,
          :from_given => by_name(:domain)
    input :space, :desc => "Space to add the domain to",
          :from_given => by_name(:space),
          :default => proc { client.current_space }
    def remove_domain
      space = input[:space]
      domain = input[:domain, space]

      with_progress("Removing #{c(domain.name, :name)} from #{c(space.name, :name)}") do
        space.remove_domain(domain)
      end
    end

    private

    def ask_domain(space)
      ask "Which domain?", :choices => space.domains,
          :display => proc(&:name)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vmc-0.5.0.beta.7 lib/vmc/cli/domain/remove_domain.rb
vmc-0.5.0.beta.6 lib/vmc/cli/domain/remove_domain.rb
vmc-0.5.0.beta.5 lib/vmc/cli/domain/remove_domain.rb
vmc-0.5.0.beta.4 lib/vmc/cli/domain/remove_domain.rb
vmc-0.5.0.beta.3 lib/vmc/cli/domain/remove_domain.rb
vmc-0.5.0.beta.2 lib/vmc/cli/domain/remove_domain.rb
vmc-0.5.0.beta.1 lib/vmc/cli/domain/remove_domain.rb