Sha256: df6287c21066e24bde336f439e746156ae4eb4235153d7a56dca0f809ae81a5c

Contents?: true

Size: 710 Bytes

Versions: 15

Compression:

Stored size: 710 Bytes

Contents

require 'optparse'

module Vagrant
  module Command
    class Destroy < Base
      def execute
        opts = OptionParser.new do |opts|
          opts.banner = "Usage: vagrant destroy [vm-name]"
        end

        # Parse the options
        argv = parse_options(opts)
        return if !argv

        @logger.debug("'Destroy' each target VM...")
        with_target_vms(argv[0]) do |vm|
          if vm.created?
            @logger.info("Destroying: #{vm.name}")
            vm.destroy
          else
            @logger.info("Not destroying #{vm.name}, since it isn't created.")
            vm.ui.info I18n.t("vagrant.commands.common.vm_not_created")
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
vagrantup-0.9.7 lib/vagrant/command/destroy.rb
vagrantup-0.9.6 lib/vagrant/command/destroy.rb
vagrantup-0.9.5 lib/vagrant/command/destroy.rb
vagrantup-0.9.4 lib/vagrant/command/destroy.rb
vagrantup-0.9.3 lib/vagrant/command/destroy.rb
vagrantup-0.9.2 lib/vagrant/command/destroy.rb
vagrantup-0.9.1 lib/vagrant/command/destroy.rb
vagrantup-0.9.0 lib/vagrant/command/destroy.rb
vagrant-0.9.7 lib/vagrant/command/destroy.rb
vagrant-0.9.5 lib/vagrant/command/destroy.rb
vagrant-0.9.4 lib/vagrant/command/destroy.rb
vagrant-0.9.3 lib/vagrant/command/destroy.rb
vagrant-0.9.2 lib/vagrant/command/destroy.rb
vagrant-0.9.1 lib/vagrant/command/destroy.rb
vagrant-0.9.0 lib/vagrant/command/destroy.rb