7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/veewee/command/vagrant/halt.rb', line 7
def execute
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Shutdown the basebox"
opts.separator ""
opts.separator "Usage: vagrant basebox halt <boxname>"
opts.on("-f", "--force", "overwrite the basebox") do |f|
options['force'] = f
end
opts.on("-d", "--debug", "enable debugging") do |d|
options['debug'] = d
end
end
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]).halt(options)
rescue Veewee::Error => ex
venv.ui.error(ex,:prefix => false)
exit -1
end
end
|