summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/texdoc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-11-18 23:03:25 +0000
committerKarl Berry <karl@freefriends.org>2017-11-18 23:03:25 +0000
commitf3c065c42a827259169112dd5dce986951eb5294 (patch)
tree7fcb9aab24669d4321b08358ccb66a50b7feea15 /Master/texmf-dist/scripts/texdoc
parent20660a493139f7da8061a165133f5ff2bc3da266 (diff)
message wording and corrections, no unrequested usage; texdoc r20-24
git-svn-id: svn://tug.org/texlive/trunk@45848 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/texdoc')
-rw-r--r--Master/texmf-dist/scripts/texdoc/constants.tlu13
-rw-r--r--Master/texmf-dist/scripts/texdoc/main.tlu11
-rw-r--r--Master/texmf-dist/scripts/texdoc/score.tlu8
-rw-r--r--Master/texmf-dist/scripts/texdoc/texdoclib.tlu4
4 files changed, 24 insertions, 12 deletions
diff --git a/Master/texmf-dist/scripts/texdoc/constants.tlu b/Master/texmf-dist/scripts/texdoc/constants.tlu
index 181cfe54e21..8b1dff224b5 100644
--- a/Master/texmf-dist/scripts/texdoc/constants.tlu
+++ b/Master/texmf-dist/scripts/texdoc/constants.tlu
@@ -1,4 +1,4 @@
--- $Id: constants.tlu 13 2017-05-17 18:09:11Z karl $
+-- $Id: constants.tlu 24 2017-11-18 23:00:18Z karl $
-- constants.tlu: global "constants" for texdoc.
--
-- Manuel Pégourié-Gonnard, GPLv3+, see texdoclib.tlu for details
@@ -21,7 +21,7 @@ end
-- progname and version
fullname = kpse.find_file('texdoc/texdoclib', 'lua')
progname = 'texdoc'
-version = '2.017'
+version = '2.0171'
-- make sure to update setup_config_from_cl() accordingly
-- and set a default value in setup_config_from_defaults() if relevant
@@ -47,15 +47,16 @@ Options:
-q, --quiet Suppress warnings and most error messages.
-v, --verbose Print additional information (eg, viewer command).
- -d, --debug[=list] Activate debug output (restricted to list).
+ -d, --debug[=LIST] Activate debug output (restricted to LIST).
Environment variables: PAGER, BROWSER, PDFVIEWER, PSVIEWER, DVIVIEWER,
and texdoc_* of each.
-Files: <texmf>/texdoc/texdoc.cnf, see output of the --files option.
+Files: <TEXMF>/texdoc/texdoc.cnf; see output of the --files option.
Full manual available via `texdoc texdoc'.
-Please report bugs to <texdoc@tug.org>.
+texdoc home page: <https://tug.org/texdoc/>
+Please email bugs to <texdoc@tug.org>.
]]
copyright_msg = [[
@@ -95,7 +96,7 @@ known_options = {
}
error_msg = [[
-Try `texdoc --help' for a short help, `texdoc texdoc' for the user manual.]]
+Try `texdoc --help' for short help, `texdoc texdoc' for full manual.]]
notfound_msg = [[
Sorry, no documentation found for PKGNAME.
diff --git a/Master/texmf-dist/scripts/texdoc/main.tlu b/Master/texmf-dist/scripts/texdoc/main.tlu
index 3b5aa3a421c..0058a55da8f 100644
--- a/Master/texmf-dist/scripts/texdoc/main.tlu
+++ b/Master/texmf-dist/scripts/texdoc/main.tlu
@@ -1,3 +1,4 @@
+-- $Id: main.tlu 24 2017-11-18 23:00:18Z karl $
-- main.tlu: default command-line interface of texdoc
--
-- Manuel Pégourié-Gonnard, GPLv3, see texdoclib.tlu for details
@@ -15,7 +16,7 @@ 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).]]
+ --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)
@@ -36,13 +37,19 @@ elseif action == 'files' then
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.print_usage()
+ texdoc.err_print('error', "no action specified")
+ texdoc.err_print('error', texdoc.const.error_msg)
os.exit(exit_usage)
end
diff --git a/Master/texmf-dist/scripts/texdoc/score.tlu b/Master/texmf-dist/scripts/texdoc/score.tlu
index ed5a31ebb60..157af9aee26 100644
--- a/Master/texmf-dist/scripts/texdoc/score.tlu
+++ b/Master/texmf-dist/scripts/texdoc/score.tlu
@@ -75,11 +75,13 @@ function set_score(df, original_kw)
-- get score from tlp associations
if score == -10 and df.tlptodoc then
score = -1
- deb_print('score', 'New score: -2 from package name association')
+ deb_print('score', 'New score: '..tostring(score)
+ ..' from package name association')
end
if score == -10 and df.runtodoc then
score = -5
- deb_print('score', 'New score: -6 from sty/cls association')
+ deb_print('score', 'New score: '..tostring(score)
+ ..' from sty/cls association')
end
-- bonus for metadata
if df.details then
@@ -152,7 +154,7 @@ function heuristic_score(file, pat)
if ext and config.badext_list_inv[ext] and score > 0 then
upscore(0.1, 'bad extension', true)
end
- -- if basename is bad, score gets < 0
+ -- if basename is bad, score becomes an epsilon
if has_bad_basename(file) and score > 0 then
upscore(0.1, 'bad basename', true)
end
diff --git a/Master/texmf-dist/scripts/texdoc/texdoclib.tlu b/Master/texmf-dist/scripts/texdoc/texdoclib.tlu
index c92ef185b17..6eeba6386e8 100644
--- a/Master/texmf-dist/scripts/texdoc/texdoclib.tlu
+++ b/Master/texmf-dist/scripts/texdoc/texdoclib.tlu
@@ -1,7 +1,8 @@
+-- $Id: texdoclib.tlu 25 2017-11-18 23:03:01Z karl $
-- texdoclib.tlu: the texdoc library
--[[
-Copyright 2008, 2009, 2010, 2011 Manuel Pégourié-Gonnard.
+Copyright 2008, 2009, 2010, 2011, 2017 Manuel Pégourié-Gonnard.
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -100,5 +101,6 @@ return {
show_config_files = show_config_files,
config = config,
view_file = view_file,
+ err_print = err_print,
const = C,
}