Readded `vagrant down` but as an error message to assist users in migrating to `vagrant destroy`
This commit is contained in:
parent
5a7e8369d5
commit
575a9f1021
|
@ -0,0 +1,16 @@
|
||||||
|
module Vagrant
|
||||||
|
class Commands
|
||||||
|
# `vagrant down` is now `vagrant destroy`
|
||||||
|
class Down < Base
|
||||||
|
Base.subcommand "down", self
|
||||||
|
|
||||||
|
def execute(args=[])
|
||||||
|
error_and_exit(:command_deprecation_down)
|
||||||
|
end
|
||||||
|
|
||||||
|
def options_spec(opts)
|
||||||
|
opts.banner = "Usage: vagrant down"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -42,6 +42,9 @@
|
||||||
vagrant box add name uri
|
vagrant box add name uri
|
||||||
vagrant box remove name
|
vagrant box remove name
|
||||||
vagrant box list
|
vagrant box list
|
||||||
|
:command_deprecation_down: |-
|
||||||
|
`vagrant down` is now `vagrant destroy`. Please use that command instead. This
|
||||||
|
warning will be removed in future versions.
|
||||||
:dotfile_error: |-
|
:dotfile_error: |-
|
||||||
The dotfile which Vagrant uses to store the UUID of the project's
|
The dotfile which Vagrant uses to store the UUID of the project's
|
||||||
virtual machine already exists and is not a file! The dotfile is
|
virtual machine already exists and is not a file! The dotfile is
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
|
||||||
|
|
||||||
|
class CommandsDownTest < Test::Unit::TestCase
|
||||||
|
setup do
|
||||||
|
@klass = Vagrant::Commands::Down
|
||||||
|
|
||||||
|
@env = mock_environment
|
||||||
|
@instance = @klass.new(@env)
|
||||||
|
end
|
||||||
|
|
||||||
|
context "executing" do
|
||||||
|
should "just error and exit" do
|
||||||
|
@instance.expects(:error_and_exit).with(:command_deprecation_down)
|
||||||
|
@instance.execute
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue