Sha256: efe0660e8adb50626e7a049dbb311426a7bf8774220271ed65f506f595c69d9e

Contents?: true

Size: 759 Bytes

Versions: 11

Compression:

Stored size: 759 Bytes

Contents

require "vmc/cli/domain/base"

module VMC::Domain
  class RemoveDomain < Base
    desc "Remove a domain from a space"
    group :domains
    input(:domain, :argument => :optional,
          :from_given => by_name("domain"),
          :desc => "Domain to add") { |space|
      ask "Which domain?", :choices => space.domains,
          :display => proc(&:name)
    }
    input :space, :from_given => by_name("space"),
          :default => proc { client.current_space },
          :desc => "Space to add the domain to"

    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
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vmc-0.4.7 lib/vmc/cli/domain/remove_domain.rb
vmc-0.4.6 lib/vmc/cli/domain/remove_domain.rb
vmc-0.4.5 lib/vmc/cli/domain/remove_domain.rb
vmc-0.4.4 lib/vmc/cli/domain/remove_domain.rb
vmc-0.4.3 lib/vmc/cli/domain/remove_domain.rb
vmc-0.4.2 lib/vmc/cli/domain/remove_domain.rb
vmc-0.4.1 lib/vmc/cli/domain/remove_domain.rb
vmc-0.4.0 lib/vmc/cli/domain/remove_domain.rb
vmc-0.4.0.beta.97 vmc-ng/lib/vmc/cli/domain/remove_domain.rb
vmc-0.4.0.beta.96 vmc-ng/lib/vmc/cli/domain/remove_domain.rb
vmc-0.4.0.beta.94 vmc-ng/lib/vmc/cli/domain/remove_domain.rb