Skip to content

Commit 1a103b6

Browse files
authored
Merge pull request #124 from mgkurtz/getopt
Fix parsing `texdoc -c --help` etc. (#121)
2 parents 9535c1f + 4ee0fe2 commit 1a103b6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

script/texdoclib-cli.tlu

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,10 @@ local function getopt(arg, options)
5858
end
5959

6060
-- check the existence of an argument
61-
if not tmp then
61+
if not tmp or tmp:match('^%-') then
6262
err_print('error',
6363
'Option -%s requires an argument.', jopt)
6464
os.exit(C.exit_error)
65-
end
66-
67-
if tmp:match('^%-') then
68-
table.insert(tab, {jopt, false})
6965
else
7066
table.insert(tab, {jopt, tmp})
7167
end

0 commit comments

Comments
 (0)