summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/texdoc/main.tlu
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/texdoc/main.tlu')
-rw-r--r--Master/texmf-dist/scripts/texdoc/main.tlu73
1 files changed, 0 insertions, 73 deletions
diff --git a/Master/texmf-dist/scripts/texdoc/main.tlu b/Master/texmf-dist/scripts/texdoc/main.tlu
deleted file mode 100644
index b5ada6e7dfb..00000000000
--- a/Master/texmf-dist/scripts/texdoc/main.tlu
+++ /dev/null
@@ -1,73 +0,0 @@
--- main.tlu: default command-line interface of texdoc
---
--- Manuel Pégourié-Gonnard and the TeX Live team, GPLv3,
--- see texdoclib.tlu for details
-
--- load texdoclib (kpse initialized by the wrapper)
-local texdoc = require('texdoc.texdoclib')
-
--- exit codes
-local exit_ok = 0
-local exit_error = 1 -- apparently hard-coded in Lua
-local exit_usage = 2
-
--- action command-line options
-local action_help = [[
- -h, --help Print this help message.
- -V, --version Print the version number.
- -f, --files Print the list of configuration files used.
- --just-view FILE Display FILE, given with full path (no searching).]]
-
--- get configuration and parse command line
-local action = texdoc.setup_config_and_alias(arg)
-if not action then
- os.exit(exit_usage)
-end
-
--- handle action options
-if action == 'help' then
- texdoc.print_usage(action_help)
- os.exit(exit_ok)
-elseif action == 'version' then
- print(texdoc.const.progname .. ' ' .. texdoc.const.version)
- print('\n' .. texdoc.const.copyright_msg)
- os.exit(exit_ok)
-elseif action == 'files' then
- print(texdoc.const.fullname .. ' ' .. texdoc.const.version)
- texdoc.show_config_files(print, true)
- os.exit(exit_ok)
-elseif action == 'view' then
- if not arg[1] then
- texdoc.err_print('error', "missing file operand to --just-view")
- texdoc.err_print('error', texdoc.const.error_msg)
- os.exit(exit_usage)
- end
- local ok = texdoc.view_file(arg[1])
- os.exit(ok and exit_ok or exit_error)
-end
-
--- make sure we actually have argument(s)
-if not arg[1] then
- texdoc.err_print('error', "no action specified")
- texdoc.err_print('error', texdoc.const.error_msg)
- os.exit(exit_usage)
-end
-
--- initialise databases
-texdoc.init_databases()
-
--- 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 = texdoc.get_doclist(docname)
- -- deliver results to the user
- texdoc.deliver_results(docname, doclist, multiarg)
-end
-
--- the end
-os.exit(exit_ok)
-
--- vim: ft=lua: