From 0936e3a25bf4d965931c133943e737163fb18512 Mon Sep 17 00:00:00 2001 From: Tom van Dijck Date: Mon, 5 Jun 2017 14:59:32 -0700 Subject: [PATCH] Add premake.info message function. --- src/base/_foundation.lua | 17 +++++++++++++++++ src/base/term.lua | 1 + 2 files changed, 18 insertions(+) diff --git a/src/base/_foundation.lua b/src/base/_foundation.lua index 9bff9def..518cb338 100644 --- a/src/base/_foundation.lua +++ b/src/base/_foundation.lua @@ -361,6 +361,23 @@ end +-- +-- Display information in the term.infoColor color. +-- +-- @param message +-- The info message, which may contain string formatting tokens. +-- @param ... +-- Values to fill in the string formatting tokens. +-- + + function premake.info(message, ...) + message = string.format(message, ...) + term.pushColor(term.infoColor) + io.stdout:write(string.format("** Info: " .. message .. "\n", ...)) + term.popColor(); + end + + -- -- A shortcut for printing formatted output. diff --git a/src/base/term.lua b/src/base/term.lua index c99cac86..7952f407 100644 --- a/src/base/term.lua +++ b/src/base/term.lua @@ -25,6 +25,7 @@ term.white = 15 -- colors for specific purpose. term.warningColor = term.magenta term.errorColor = term.lightRed +term.infoColor = term.lightCyan -- color stack implementation. term._colorStack = {}