Support bold style and add #clear_line

This commit is contained in:
Chris Roberts 2022-02-25 15:58:08 -08:00 committed by Paul Hinze
parent 6ba7807f7b
commit df0bbe343f
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -6,7 +6,7 @@ module VagrantPlugins
STYLE = {
detail: "info",
info: "info",
output: "output",
output: "info",
warn: "warning",
error: "error",
success: "success",
@ -36,18 +36,33 @@ module VagrantPlugins
# @param [Array] lines Lines to print
def output(line, **opts)
style = STYLE[opts[:style]]
if opts[:bold] && style != "header"
style = "#{style}-bold"
end
client.events(
[
SDK::TerminalUI::Event.new(
line: SDK::TerminalUI::Event::Line.new(
msg: line,
style: STYLE[opts[:style]],
style: style,
disable_new_line: !opts[:new_line],
)
)
].each
).each {}
end
def clear_line
client.events(
[
SDK::TerminalUI::Event.new(
clear_line: SDK::TerminalUI::Event::ClearLine.new
)
].each
).each {}
end
end
end
end