diff --git a/client/scripts/dumptoemul-mfu.lua b/client/scripts/dumptoemul-mfu.lua index a5c6c5e39..b308c79e5 100644 --- a/client/scripts/dumptoemul-mfu.lua +++ b/client/scripts/dumptoemul-mfu.lua @@ -15,19 +15,29 @@ Arguments: -o Specifies the output file. If omitted, .eml is used. ]] +local DEBUG = false + --- -- A debug printout-function -function dbg(args) - if DEBUG then - print("###", args) +local function dbg(args) + if not DEBUG then return end + + if type(args) == 'table' then + local i = 1 + while result[i] do + dbg(result[i]) + i = i+1 + end + else + print('###', args) end end --- -- This is only meant to be used when errors occur -function oops(err) - print("ERROR: ",err) +local function oops(err) + print('ERROR: ',err) + return nil,err end - --- -- Usage help function help() diff --git a/client/scripts/dumptoemul.lua b/client/scripts/dumptoemul.lua index 67520f232..1e4d6323a 100644 --- a/client/scripts/dumptoemul.lua +++ b/client/scripts/dumptoemul.lua @@ -16,22 +16,31 @@ Arguments: -o Specifies the output file. If omitted, .eml is used. ]] - +local DEBUG = false ------------------------------- -- Some utilities ------------------------------- --- -- A debug printout-function -function dbg(args) - if DEBUG then - print("###", args) +local function dbg(args) + if not DEBUG then return end + + if type(args) == 'table' then + local i = 1 + while result[i] do + dbg(result[i]) + i = i+1 + end + else + print('###', args) end end --- -- This is only meant to be used when errors occur -function oops(err) - print("ERROR: ",err) +local function oops(err) + print('ERROR: ',err) + return nil,err end --- -- Usage help