diff options
Diffstat (limited to 'Master/texmf/scripts')
-rwxr-xr-x | Master/texmf/scripts/texlive/texdoc.tlu | 14 |
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) |