From df3534903c7dd93b4ad82b2f790be4c6a96cb503 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 27 Apr 2008 08:35:39 +0000 Subject: support -- or - style git-svn-id: svn://tug.org/texlive/trunk@7675 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/lua/getopt.tlu | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3