diff options
-rw-r--r-- | Master/texmf/scripts/texlive/lua/getopt.tlu | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Master/texmf/scripts/texlive/lua/getopt.tlu b/Master/texmf/scripts/texlive/lua/getopt.tlu index bdccba8c13e..2327f05698f 100644 --- a/Master/texmf/scripts/texlive/lua/getopt.tlu +++ b/Master/texmf/scripts/texlive/lua/getopt.tlu @@ -24,6 +24,9 @@ -- options["help"] = true -- options["foo"] = "f" -- options["bar"] = { "c", "d" } +-- +-- Options can start with a single or a double dash, but values may NOT be +-- separated with a =, but need to be seprate arguments! -- -- Example code for printing out the options: -- print ("OPTIONS:") @@ -47,7 +50,7 @@ function getopt(spec) while (i <= limit) do local found = false for k,v in pairs(spec) do - if (arg[i] == "--"..k) then + if (arg[i] == "--"..k or arg[i] == "-"..k) then found = true if (v == 0) then -- boolean argument |