diff --git a/lib/vagrant/command/destroy.rb b/lib/vagrant/command/destroy.rb index 8f7c3f726..3a68eb301 100644 --- a/lib/vagrant/command/destroy.rb +++ b/lib/vagrant/command/destroy.rb @@ -1,7 +1,7 @@ module Vagrant module Command class DestroyCommand < Base - desc "Destroy the environment, deleting the created virtual machines." + desc "Destroy the environment, deleting the created virtual machines" register "destroy" def execute diff --git a/lib/vagrant/command/halt.rb b/lib/vagrant/command/halt.rb new file mode 100644 index 000000000..a1df59a4b --- /dev/null +++ b/lib/vagrant/command/halt.rb @@ -0,0 +1,19 @@ +module Vagrant + module Command + class HaltCommand < Base + desc "Halt the running VMs in the environment" + class_option :force, :type => :boolean, :default => false, :aliases => "-f" + register "halt" + + def execute + target_vms.each do |vm| + if vm.created? + vm.halt(options) + else + vm.env.ui.info "VM not created. Moving on..." + end + end + end + end + end +end