Class: Veewee::Command::BaseboxDestroy

Inherits:
Vagrant::Command::Base
  • Object
show all
Defined in:
lib/veewee/command/basebox_destroy.rb

Instance Method Summary collapse

Instance Method Details

#executeObject

Raises:

  • (Vagrant::Errors::CLIInvalidUsage)


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/veewee/command/basebox_destroy.rb', line 4

def execute
  options = {}

  opts = OptionParser.new do |opts|
    opts.banner = "Destroys the virtualmachine that was build for a basebox"
    opts.separator ""
    opts.separator "Usage: vagrant basebox destroy <boxname>"
  end

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

  Veewee::Session.destroy_vm(argv[0])
end