Sha256: b966c419a81eed3aec50b161d247d218ad2d126550c11d795aa1921c8457b089

Contents?: true

Size: 1.22 KB

Versions: 29

Compression:

Stored size: 1.22 KB

Contents

require 'optparse'

module Veewee
  module Command
    module Vagrant
      class Destroy < ::Vagrant::Command::Base
        def execute
          options = {}

          opts = OptionParser.new do |opts|
            opts.banner = "Destroy the basebox that was built"
            opts.separator ""
            opts.separator "Usage: vagrant basebox destroy <boxname>"

            opts.on("-f", "--force", "overwrite the basebox") do |f|
              options['force'] = f
            end

            opts.on("-n", "--nogui", "no gui") do |n|
              options['nogui'] = n
            end

            opts.on("-d", "--debug", "enable debugging") do |d|
              options['debug'] = d
            end

          end

          # Parse the options
          argv = parse_options(opts)
          return if !argv
          raise ::Vagrant::Errors::CLIInvalidUsage, :help => opts.help.chomp if argv.length < 1

          begin
            venv=Veewee::Environment.new(options)
            venv.ui=@env.ui
            venv.providers["virtualbox"].get_box(argv[0]).destroy(options)
          rescue Veewee::Error => ex
            venv.ui.error(ex,:prefix => false)
            exit -1
          end

        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
veewee-0.5.0.alpha4 lib/veewee/command/vagrant/destroy.rb
veewee-0.5.0.alpha3 lib/veewee/command/vagrant/destroy.rb
veewee-0.5.0.alpha2 lib/veewee/command/vagrant/destroy.rb
veewee-0.5.0.alpha1 lib/veewee/command/vagrant/destroy.rb
veewee-0.4.5.1 lib/veewee/command/vagrant/destroy.rb
veewee-0.4.5 lib/veewee/command/vagrant/destroy.rb
veewee-0.4.5.pre1 lib/veewee/command/vagrant/destroy.rb
veewee-0.4.4 lib/veewee/command/vagrant/destroy.rb
veewee-0.4.3 lib/veewee/command/vagrant/destroy.rb
veewee-0.4.2 lib/veewee/command/vagrant/destroy.rb
veewee-0.4.1 lib/veewee/command/vagrant/destroy.rb
veewee-0.4.0 lib/veewee/command/vagrant/destroy.rb
veewee-0.3.12 lib/veewee/command/vagrant/destroy.rb
veewee-0.3.11 lib/veewee/command/vagrant/destroy.rb
veewee-0.3.10 lib/veewee/command/vagrant/destroy.rb
veewee-0.3.9 lib/veewee/command/vagrant/destroy.rb
veewee-atlassian-0.3.11 lib/veewee/command/vagrant/destroy.rb
veewee-0.3.7 lib/veewee/command/vagrant/destroy.rb
veewee-0.3.6 lib/veewee/command/vagrant/destroy.rb
veewee-0.3.5 lib/veewee/command/vagrant/destroy.rb