File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ SILE.lua_isjit = type(jit) == "table"
4747-- @string full_version
4848SILE .full_version = string.format (" SILE %s (%s)" , SILE .version , SILE .lua_isjit and jit .version or _VERSION )
4949
50+ --- Default to verbose mode, can be changed from the CLI or by libraries
51+ --- @boolean quiet
52+ SILE .quiet = false
53+
5054-- Backport of lots of Lua 5.3 features to Lua 5.[12]
5155if not SILE .lua_isjit and SILE .lua_version < " 5.3" then
5256 require (" compat53" )
Original file line number Diff line number Diff line change @@ -326,6 +326,7 @@ local _skip_traceback_levels = 2
326326-- @tparam string message The error message to give.
327327-- @tparam boolean isbug Whether or not hitting this error is expected to be a code bug (as opposed to misakes in user input).
328328function utilities .error (message , isbug )
329+ SILE .quiet = false
329330 _skip_traceback_levels = 3
330331 utilities .warn (message , isbug )
331332 _skip_traceback_levels = 2
350351-- @tparam string message The error message to give.
351352-- @tparam boolean isbug Whether or not hitting this warning is expected to be a code bug (as opposed to misakes in user input).
352353function utilities .warn (message , isbug )
354+ if SILE .quiet then
355+ return
356+ end
353357 utilities .msg (message )
354358 if SILE .traceback or isbug then
355359 io.stderr :write (" at:\n " .. SILE .traceStack :locationTrace ())
You can’t perform that action at this time.
0 commit comments