diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-07-17 07:11:12 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-07-17 07:11:12 +0000 |
commit | b72837827d9290c7ec50b9e4b9e1a0f194ddccca (patch) | |
tree | 8df663325413d0f92086d740638555de6b779df7 /src/lib/getopt.lua | |
parent | Adding upstream version 1.1.0+debian. (diff) | |
download | dnsjit-b72837827d9290c7ec50b9e4b9e1a0f194ddccca.tar.xz dnsjit-b72837827d9290c7ec50b9e4b9e1a0f194ddccca.zip |
Adding upstream version 1.2.1.upstream/1.2.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/lib/getopt.lua')
-rw-r--r-- | src/lib/getopt.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/getopt.lua b/src/lib/getopt.lua index 91ce6cd..ede3e12 100644 --- a/src/lib/getopt.lua +++ b/src/lib/getopt.lua @@ -122,6 +122,9 @@ function Getopt:add(short, long, default, help, extensions) elseif name == "" then error("name (long|short) needs to be set") end + if short and (type(short) ~= "string" or #short ~= 1) then + error("short needs to be a string of length 1") + end if self._opt[name] then error("option "..name.." alredy exists") |