diff options
author | soumith <soumith@gmail.com> | 2016-03-08 05:42:34 +0300 |
---|---|---|
committer | soumith <soumith@gmail.com> | 2016-03-08 05:42:34 +0300 |
commit | 9a41915d490dd6d6530c963911f56a81d64f850e (patch) | |
tree | 0db4b377308bb17cd3807155c122b17cc1a7feba | |
parent | 6706567b10f745eec57b5b4824558104c86d20ad (diff) |
making sys optionalsysopt
-rw-r--r-- | Tester.lua | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,6 +1,4 @@ -require 'sys' -- for sys.COLORS - -- Lua 5.2 compatibility local unpack = unpack or table.unpack @@ -380,7 +378,8 @@ end local NCOLS = 80 local coloured local c = {} -if arg then -- have we been invoked from the commandline? +local enable_colors = pcall(require, 'sys') +if arg and enable_colors then -- have we been invoked from the commandline? c = sys.COLORS coloured = function(str, colour) return colour .. str .. c.none |