summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-07-28 23:07:26 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-07-28 23:07:26 +0000
commit83db8fed57f1bb86a50e119a5e97896a783c1e6b (patch)
treed7987764cbf72bc5abcb7e6d7ddd18e4bf8b3e5c /Master
parent439e3af0a2b452752a16fc844f5ac609567b977a (diff)
new -r|--regex option
git-svn-id: svn://tug.org/texlive/trunk@9855 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/texmf/scripts/texlive/texdoc.tlu14
1 files changed, 13 insertions, 1 deletions
diff --git a/Master/texmf/scripts/texlive/texdoc.tlu b/Master/texmf/scripts/texlive/texdoc.tlu
index d09055f27fa..14d5fe3becf 100755
--- a/Master/texmf/scripts/texlive/texdoc.tlu
+++ b/Master/texmf/scripts/texlive/texdoc.tlu
@@ -46,6 +46,7 @@ Usage: texdoc -h, --help | -V, --version | [option(s)] name(s)
-m|--mixed Use mixed mode (view or list).
-l|--list Use list mode: don't start a viewer.
-s|--search Search for name as a substring.
+ -r|--regex Search for name as a lua regex.
Typing `texdoc texdoc' gives you the complete manual.]]
notfound_msg = [[
Sorry, no documentation found for PKGNAME.
@@ -304,6 +305,8 @@ function setup_config_from_cl ()
set_config_element('mode', 'list')
elseif (curr_arg == '-s') or (curr_arg == '--search') then
set_config_element ('mode', 'search')
+ elseif (curr_arg == '-r') or (curr_arg == '--regex') then
+ set_config_element ('mode', 'regex')
elseif (curr_arg == '-I') or (curr_arg == '--nointeractive') then
set_config_element('interactive', 'false')
elseif (curr_arg == '-i') or (curr_arg == '--interactive') then
@@ -737,7 +740,15 @@ for docname in list (arg) do
docname = alias[docname]
end
local docfound = false
- if (config.mode == 'search') then
+ if (config.mode == 'regex') then
+ no_regex = false
+ populate_docfiles(docname)
+ if rel_docfiles[1] then
+ print_menu (rel_docfiles)
+ else
+ apologize ('notfound', docname)
+ end
+ elseif (config.mode == 'search') then
populate_docfiles(docname)
if exact_docfiles[1] or rel_docfiles[1] then
print_menu (exact_docfiles, rel_docfiles)
@@ -754,6 +765,7 @@ for docname in list (arg) do
elseif (config.mode == 'view') then
mixed_populate_docfiles (docname)
if exact_docfiles[1] then
+ table.sort(exact_docfiles, file_order)
try_viewing (how_to_view(exact_docfiles[1]))
else
apologize ('notfound', docname)