aboutsummaryrefslogtreecommitdiffstats
path: root/PolygLua.lua
diff options
context:
space:
mode:
Diffstat (limited to 'PolygLua.lua')
-rwxr-xr-xPolygLua.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/PolygLua.lua b/PolygLua.lua
index 77f01f4..17abd88 100755
--- a/PolygLua.lua
+++ b/PolygLua.lua
@@ -41,8 +41,8 @@ _G.C = function(s) log(-1, 'CRITICAL ', s) end
41local optionsCommon = 41local optionsCommon =
42{ 42{
43 help = {help = 'Print the help text.', 43 help = {help = 'Print the help text.',
44 func = function(self, options, a, args, i) 44 func = function(self, options, a, args, i, name)
45 for i,v in ipairs{'/usr/share/doc/', '/usr/local/share/doc/', './'} do 45 for i,v in ipairs{'/usr/share/doc/' .. name, '/usr/local/share/doc/' .. name, './'} do
46 local p = v .. 'README.md' 46 local p = v .. 'README.md'
47 local h = io.open(p, 'r') 47 local h = io.open(p, 'r')
48 if nil ~= h then 48 if nil ~= h then
@@ -108,7 +108,7 @@ _.parse = function(args, options, name)
108 if nil == o then o = optionsCommon[name] end 108 if nil == o then o = optionsCommon[name] end
109 if nil ~= o then 109 if nil ~= o then
110 if nil ~= val then o.value = val; D(name .. ' = ' .. tostring(val)) end 110 if nil ~= val then o.value = val; D(name .. ' = ' .. tostring(val)) end
111 if nil ~= o.func then o:func(options, a, args, i) end 111 if nil ~= o.func then o:func(options, a, args, i, name) end
112 end 112 end
113 return o 113 return o
114 end 114 end