summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-07-15 16:43:36 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-07-15 16:43:36 +0000
commit2eae66da15b6168af57195d32562513be9245657 (patch)
treecd8641a2ef4f5c2678db8f005a11e0752430fdbd
parent4e37eff341c068279960f097abdde58f6b598bdf (diff)
replacing string.match with a == b when possible
git-svn-id: svn://tug.org/texlive/trunk@9576 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/texmf/scripts/texlive/texdoc.tlu21
1 files changed, 8 insertions, 13 deletions
diff --git a/Master/texmf/scripts/texlive/texdoc.tlu b/Master/texmf/scripts/texlive/texdoc.tlu
index d106d533a61..d7a3e655cd5 100755
--- a/Master/texmf/scripts/texlive/texdoc.tlu
+++ b/Master/texmf/scripts/texlive/texdoc.tlu
@@ -63,22 +63,17 @@ mode = 'view'
verbose = false
while table.maxn(arg) > 0 and string.match(arg[1],'^%-') do
curr_arg = table.remove(arg,1)
- if string.match (curr_arg,'-h')
- or string.match (curr_arg,'--help') then
+ if (curr_arg == '-h') or (curr_arg == '--help') then
print (usage_msg)
os.exit(0)
- elseif string.match (curr_arg,'-V')
- or string.match (curr_arg,'--version') then
+ elseif (curr_arg == '-V') or (curr_arg == '--version') then
print (progname .. ' version: ' .. version )
os.exit(0)
- elseif string.match (curr_arg,'-v')
- or string.match (curr_arg,'--verbose') then
+ elseif (curr_arg == '-v') or (curr_arg == '--verbose') then
verbose = true
- elseif string.match (curr_arg,'-l')
- or string.match (curr_arg,'--list') then
+ elseif (curr_arg == '-l') or (curr_arg == '--list') then
mode = 'list'
- elseif string.match (curr_arg,'-s')
- or string.match (curr_arg,'--search') then
+ elseif (curr_arg == '-s') or (curr_arg == '--search') then
mode = 'search'
end
end
@@ -494,16 +489,16 @@ for docname in list_iter (arg) do
docname = alias[docname]
end
local docfound = false
- if string.match(mode,'search') then
+ if (mode == 'search') then
docfound = true
pattern_search(docname)
- elseif string.match(mode,'view') or string.match(mode,'list') then
+ elseif (mode == 'view') or (mode == 'list') then
for ext in list_iter(config.ext_list) do
filename = kpse.find_file(docname .. ext,
"TeX system documentation")
if filename then
docfound = true
- if string.match (mode, 'list') then
+ if (mode == 'list') then
print(filename)
else -- mode is view, is unzipping needed?
prepare_viewing(ext)