global lookup hack for -m was over-hasty

This commit is contained in:
steve donovan 2011-06-14 12:24:20 +02:00
parent d4c04661ba
commit 2487dea7fa
1 changed files with 3 additions and 2 deletions

View File

@ -14,7 +14,7 @@ local lapp = require 'pl.lapp'
app.require_here()
local args = lapp [[
ldoc, a documentation generator for Lua, vs 0.2 Beta
ldoc, a documentation generator for Lua, vs 0.3 Beta
-d,--dir (default docs) output directory
-o,--output (default 'index') output name
-v,--verbose verbose
@ -447,7 +447,7 @@ local doc_path = ldoc_dir..'builtin/?.luadoc'
-- ldoc -m is expecting a Lua package; this converts this to a file path
if args.module then
if _G[args.file] then
if type(_G[args.file]) ~= 'table' then
args.file = 'global.'..args.file
end
local fullpath,mod = tools.lookup_existing_module_or_function (args.file, doc_path)
@ -456,6 +456,7 @@ if args.module then
else
args.file = fullpath
args.module = mod
print(fullpath,mod)
end
end