diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2008-07-28 21:34:32 +0000 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2008-07-28 21:34:32 +0000 |
commit | ed6efd6b2b5e4e45a8e0f8a27074443bdc93db9c (patch) | |
tree | 361f0450acbaa4551bc74737475664e91a326824 | |
parent | 00d01eaaa1229e08933e3949be0cf0530ef13b7f (diff) |
Re-arranging a few things about modes and enable_alias; setting verbose = false by default.
git-svn-id: svn://tug.org/texlive/trunk@9852 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Master/texmf/scripts/texlive/texdoc.tlu | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/Master/texmf/scripts/texlive/texdoc.tlu b/Master/texmf/scripts/texlive/texdoc.tlu index 4c09d307cdf..d09055f27fa 100755 --- a/Master/texmf/scripts/texlive/texdoc.tlu +++ b/Master/texmf/scripts/texlive/texdoc.tlu @@ -224,7 +224,9 @@ end function mixed_populate_docfiles (pattern) populate_docfiles (pattern) if not exact_docfiles[1] then - print ("texdoc info: No exact match, trying full search mode.") + if not string.find (pattern, '/') then + print ("texdoc info: No exact match, trying full search mode.") + end exact_docfiles = rel_docfiles end end @@ -301,7 +303,7 @@ function setup_config_from_cl () elseif (curr_arg == '-l') or (curr_arg == '--list') then set_config_element('mode', 'list') elseif (curr_arg == '-s') or (curr_arg == '--search') then - set_config_list { mode = 'search', enable_alias = 'false'} + set_config_element ('mode', 'search') elseif (curr_arg == '-I') or (curr_arg == '--nointeractive') then set_config_element('interactive', 'false') elseif (curr_arg == '-i') or (curr_arg == '--interactive') then @@ -322,6 +324,15 @@ function setup_config_from_cl () end end +-- the default value af config.enable_alias depends on the mode as follows +function alias_from_mode (mode) + if (mode == 'view') or (mode == 'mixed') or (mode == 'list') then + return 'true' + else + return 'false' + end +end + -- set config from environment if available function setup_config_from_env () set_config_list { @@ -477,10 +488,11 @@ function setup_config_from_defaults() -- then mode, alias, verbosity set_config_list { mode = 'view', - enable_alias = 'true', -- string, not boolean - verbose = 'true', + verbose = 'false', interactive = 'true', } + -- must be set after mode! + set_config_element ('enable_alias', alias_from_mode(config.mode)) -- now a particular case for config.ext_list and zip-related stuff -- Note: removed texdoc_formats/zip_formats, gives simpler & generic code if support_zipped then @@ -720,7 +732,6 @@ interactive = (config.interactive == 'true') exit_code = 0 for docname in list (arg) do - original_docname = docname if enable_alias and alias[docname] then print ("texdoc info: "..docname.." aliased to "..alias[docname]) docname = alias[docname] |