From b951c0e781290a5eddb1c146236e9d5f2e746e07 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Mon, 5 Nov 2018 09:58:12 -0800 Subject: [PATCH] Move login command warning This commit moves where the warning is for the login command so that it only displays when the command is invoked, and not when the plugin is loaded. --- lib/vagrant/cli.rb | 4 ++++ plugins/commands/login/plugin.rb | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/cli.rb b/lib/vagrant/cli.rb index 2017c0fdc..ed5154b46 100644 --- a/lib/vagrant/cli.rb +++ b/lib/vagrant/cli.rb @@ -23,6 +23,10 @@ module Vagrant return 0 end + if @sub_command == "login" + $stderr.puts "WARNING: This command has been deprecated and aliased to `vagrant cloud auth login`" + end + # If we reached this far then we must have a subcommand. If not, # then we also just print the help and exit. command_plugin = nil diff --git a/plugins/commands/login/plugin.rb b/plugins/commands/login/plugin.rb index a82d84fe6..e0644a1c4 100644 --- a/plugins/commands/login/plugin.rb +++ b/plugins/commands/login/plugin.rb @@ -14,7 +14,6 @@ module VagrantPlugins command(:login) do require File.expand_path("../../cloud/auth/login", __FILE__) init! - $stderr.puts "WARNING: This command has been deprecated in favor of `vagrant cloud auth login`" VagrantPlugins::CloudCommand::AuthCommand::Command::Login end