`vagrant halt`

This commit is contained in:
Mitchell Hashimoto 2010-08-24 23:10:58 -07:00
parent fd5b2dee27
commit 0e43d8b55f
2 changed files with 20 additions and 1 deletions

View File

@ -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

View File

@ -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