aboutsummaryrefslogtreecommitdiff
path: root/nomsu.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-10-08 20:41:05 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2017-10-08 20:41:05 -0700
commite8c820b8f566297ef2330260c2d092012c3d2622 (patch)
tree120f84ea9c90e6a263b7bf54520bee50a5aef69b /nomsu.lua
parent87e4777aee530fa3bd6ce6fe1d7a206819247660 (diff)
Moved colors to only when invoking from command line.
Diffstat (limited to 'nomsu.lua')
-rw-r--r--nomsu.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/nomsu.lua b/nomsu.lua
index 29879b9..0ed111c 100644
--- a/nomsu.lua
+++ b/nomsu.lua
@@ -2,7 +2,11 @@ local re = require('re')
local lpeg = require('lpeg')
local utils = require('utils')
local repr = utils.repr
-local colors = require('consolecolors')
+local colors = setmetatable({ }, {
+ __index = function()
+ return ""
+ end
+})
local colored = setmetatable({ }, {
__index = function(_, color)
return (function(msg)
@@ -842,6 +846,7 @@ do
NomsuCompiler = _class_0
end
if arg then
+ colors = require('consolecolors')
local parser = re.compile([[ args <- {| {:flags: flags? :} ({:input: input :} ";" ("-o;"{:output: output :} ";")?)? (";")? |} !.
flags <- (({| ({flag} ";")* |}) -> set)
flag <- "-c" / "-i" / "-p" / "-f" / "--help" / "-h"