From 4d514e53f8675e49bcf2ebb498b0a3556df6a8d5 Mon Sep 17 00:00:00 2001 From: tdijck Date: Wed, 25 Mar 2015 09:39:47 -0700 Subject: [PATCH] add verbosef --- src/_premake_init.lua | 6 ++++++ src/base/_foundation.lua | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/src/_premake_init.lua b/src/_premake_init.lua index efd54758..33b62a78 100644 --- a/src/_premake_init.lua +++ b/src/_premake_init.lua @@ -1053,6 +1053,12 @@ description = "Display this information" } + newoption + { + trigger = "verbose", + description = "Generate extra debug text output" + } + newoption { trigger = "interactive", diff --git a/src/base/_foundation.lua b/src/base/_foundation.lua index 7a21c7ee..cd57523f 100644 --- a/src/base/_foundation.lua +++ b/src/base/_foundation.lua @@ -211,3 +211,12 @@ function printf(msg, ...) print(string.format(msg, unpack(arg))) end + +-- +-- A shortcut for printing formatted output in verbose mode. +-- + function verbosef(msg, ...) + if _OPTIONS.verbose then + print(string.format(msg, ...)) + end + end