docs: move all eolian init logic into doctree

This commit is contained in:
Daniel Kolesa 2016-08-15 13:53:01 +01:00
parent e9ddce647c
commit b6d869c3f3
2 changed files with 19 additions and 14 deletions

View File

@ -428,9 +428,23 @@ M.Event = Node:clone {
M.scan_directory = function(dir)
if not dir then
return eolian.system_directory_scan()
if not eolian.system_directory_scan() then
error("failed scanning system directory")
end
return
end
if not eolian.directory_scan(dir) then
error("failed scanning directory: " .. dir)
end
end
M.parse = function()
if not eolian.all_eot_files_parse() then
error("failed parsing eo type files")
end
if not eolian.all_eo_files_parse() then
error("failed parsing eo files")
end
return eolian.directory_scan(dir)
end
return M

View File

@ -1092,22 +1092,13 @@ getopt.parse {
dr = dutil.path_join(dr, dutil.nspace_to_path(rootns))
dutil.init(dr)
if #args == 0 then
if not dtree.scan_directory() then
error("failed scanning system directory")
end
dtree.scan_directory()
else
for i, p in ipairs(args) do
if not dtree.scan_directory(p) then
error("failed scanning directory: " .. p)
end
dtree.scan_directory(p)
end
end
if not eolian.all_eot_files_parse() then
error("failed parsing eo type files")
end
if not eolian.all_eo_files_parse() then
error("failed parsing eo files")
end
dtree.parse()
stats.init(not not opts["v"])
local wfeatures = {
notes = not opts["disable-notes"],