-- texdoc's main() --[[ Copyright 2008, 2009 Manuel Pégourié-Gonnard Distributed under the terms of the GNU GPL version 3 or later. See texdoc.tlu for details. --]] -- Load a private environment for this submodule (see texdoc.tlu). local L = {} load_env(L, { 'os', 'arg', 'print', 'setup_config_and_alias', 'init_databases', 'print_usage', 'get_doclist', 'deliver_results', 'aliased_names', }) -- get started setup_config_and_alias(arg) init_databases() -- make sure we actually have argument(s) if not arg[1] then print_usage() os.exit(C.exit_usage) end -- main loop local docname for _, docname in ipairs(arg) do -- do we have more then one argument? local multiarg = not not arg[2] -- get results local doclist = get_doclist(docname) -- deliver results to the user deliver_results(docname, doclist, multiarg) end