Sha256: 65c9d6a479c9f8f27ebe31b884645534f7d37d74860a1a3062d52be13e2368ad

Contents?: true

Size: 774 Bytes

Versions: 13

Compression:

Stored size: 774 Bytes

Contents

module VagrantPlugins
  module CommandDestroy
    class Command < Vagrant.plugin("2", :command)
      def execute
        options = {}
        options[:force] = false

        opts = OptionParser.new do |o|
          o.banner = "Usage: vagrant destroy [vm-name]"
          o.separator ""

          o.on("-f", "--force", "Destroy without confirmation.") do |f|
            options[:force] = f
          end
        end

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

        @logger.debug("'Destroy' each target VM...")
        with_target_vms(argv, :reverse => true) do |vm|
          vm.action(:destroy, :force_confirm_destroy => options[:force])
        end

        # Success, exit status 0
        0
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 5 rubygems

Version Path
vagrant-shell-0.2.9 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/plugins/commands/destroy/command.rb
tnargav-1.2.3 plugins/commands/destroy/command.rb
vagrant-shell-0.2.8 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/plugins/commands/destroy/command.rb
vagrant-shell-0.2.6 vendor/bundle/gems/tnargav-1.2.2/plugins/commands/destroy/command.rb
vagrant-shell-0.2.5 vendor/bundle/gems/tnargav-1.2.2/plugins/commands/destroy/command.rb
tnargav-1.2.2 plugins/commands/destroy/command.rb
vagrantup-1.1.3 plugins/commands/destroy/command.rb
vagrantup-1.1.2 plugins/commands/destroy/command.rb
vagrantup-1.1.1 plugins/commands/destroy/command.rb
vagrantup-1.1.0 plugins/commands/destroy/command.rb
vagrantup-1.1.4 plugins/commands/destroy/command.rb
vagrant-actionio-0.0.9 vendor/bundle/bundler/gems/vagrant-c74251a1d9c0/plugins/commands/destroy/command.rb
vagrant-lxc-0.0.1 vendor/vagrant/plugins/commands/destroy/command.rb