Since I18n isn't automatic for UI class, get rid of _ prefix on options
This commit is contained in:
parent
d003cc4f32
commit
b909adde1c
|
@ -14,7 +14,7 @@ begin
|
|||
# Kick start the CLI
|
||||
Vagrant::CLI.start(ARGV, :env => env)
|
||||
rescue Vagrant::Errors::VagrantError => e
|
||||
opts = { :_prefix => false }
|
||||
opts = { :prefix => false }
|
||||
env.ui.error e.message, opts if e.message
|
||||
env.ui.error e.backtrace.join("\n"), opts if ENV["VAGRANT_DEBUG"]
|
||||
exit e.status_code if e.respond_to?(:status_code)
|
||||
|
|
|
@ -25,8 +25,8 @@ module Vagrant
|
|||
desc "list", "Lists all installed boxes"
|
||||
def list
|
||||
boxes = env.boxes.sort
|
||||
return env.ui.warn(I18n.t("vagrant.commands.box.no_installed_boxes"), :_prefix => false) if boxes.empty?
|
||||
boxes.each { |b| env.ui.info(b.name, :_prefix => false) }
|
||||
return env.ui.warn(I18n.t("vagrant.commands.box.no_installed_boxes"), :prefix => false) if boxes.empty?
|
||||
boxes.each { |b| env.ui.info(b.name, :prefix => false) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@ module Vagrant
|
|||
:ssh_user => vm.env.config.ssh.username,
|
||||
:ssh_port => vm.ssh.port,
|
||||
:private_key_path => vm.env.config.ssh.private_key_path
|
||||
}), :_prefix => false)
|
||||
}), :prefix => false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -16,7 +16,7 @@ module Vagrant
|
|||
env.ui.info(I18n.t("vagrant.commands.status.output",
|
||||
:states => results.join("\n"),
|
||||
:message => I18n.t("vagrant.commands.status.#{state}")),
|
||||
:_prefix => false)
|
||||
:prefix => false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,22 +6,22 @@ module Vagrant
|
|||
register "upgrade_to_060", "Upgrade pre-0.6.0 environment to 0.6.0", :hide => true
|
||||
|
||||
def execute
|
||||
@env.ui.warn I18n.t("vagrant.commands.upgrade_to_060.info"), :_prefix => false
|
||||
@env.ui.warn "", :_prefix => false
|
||||
if !@env.ui.yes? I18n.t("vagrant.commands.upgrade_to_060.ask"), :_prefix => false, :_color => :yellow
|
||||
@env.ui.info I18n.t("vagrant.commands.upgrade_to_060.quit"), :_prefix => false
|
||||
@env.ui.warn I18n.t("vagrant.commands.upgrade_to_060.info"), :prefix => false
|
||||
@env.ui.warn "", :prefix => false
|
||||
if !@env.ui.yes? I18n.t("vagrant.commands.upgrade_to_060.ask"), :prefix => false, :color => :yellow
|
||||
@env.ui.info I18n.t("vagrant.commands.upgrade_to_060.quit"), :prefix => false
|
||||
return
|
||||
end
|
||||
|
||||
local_data = @env.local_data
|
||||
if !local_data.empty?
|
||||
if local_data[:active]
|
||||
@env.ui.confirm I18n.t("vagrant.commands.upgrade_to_060.already_done"), :_prefix => false
|
||||
@env.ui.confirm I18n.t("vagrant.commands.upgrade_to_060.already_done"), :prefix => false
|
||||
return
|
||||
end
|
||||
|
||||
# Backup the previous file
|
||||
@env.ui.info I18n.t("vagrant.commands.upgrade_to_060.backing_up"), :_prefix => false
|
||||
@env.ui.info I18n.t("vagrant.commands.upgrade_to_060.backing_up"), :prefix => false
|
||||
FileUtils.cp(local_data.file_path, "#{local_data.file_path}.bak-#{Time.now.to_i}")
|
||||
|
||||
# Gather the previously set virtual machines into a single
|
||||
|
@ -38,7 +38,7 @@ module Vagrant
|
|||
local_data.commit
|
||||
end
|
||||
|
||||
@env.ui.confirm I18n.t("vagrant.commands.upgrade_to_060.complete"), :_prefix => false
|
||||
@env.ui.confirm I18n.t("vagrant.commands.upgrade_to_060.complete"), :prefix => false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@ module Vagrant
|
|||
def version
|
||||
env.ui.info(I18n.t("vagrant.commands.version.output",
|
||||
:version => Vagrant::VERSION),
|
||||
:_prefix => false)
|
||||
:prefix => false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -34,7 +34,7 @@ module Vagrant
|
|||
[:ask, :no?, :yes?].each do |method|
|
||||
define_method(method) do |message, opts=nil|
|
||||
opts ||= {}
|
||||
@shell.send(method, format_message(message, opts), opts[:_color])
|
||||
@shell.send(method, format_message(message, opts), opts[:color])
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -50,8 +50,8 @@ module Vagrant
|
|||
protected
|
||||
|
||||
def format_message(message, opts=nil)
|
||||
opts = { :_prefix => true }.merge(opts || {})
|
||||
message = "[#{env.resource}] #{message}" if opts[:_prefix]
|
||||
opts = { :prefix => true }.merge(opts || {})
|
||||
message = "[#{env.resource}] #{message}" if opts[:prefix]
|
||||
message
|
||||
end
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class ShellUITest < Test::Unit::TestCase
|
|||
true
|
||||
end
|
||||
|
||||
@instance.info("vagrant.errors.test_key", :_prefix => false)
|
||||
@instance.info("vagrant.errors.test_key", :prefix => false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue