summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class4
1 files changed, 4 insertions, 0 deletions
diff --git a/it.class b/it.class
index 0a3fc18..f9c5846 100644
--- a/it.class
+++ b/it.class
@@ -839,7 +839,11 @@ static function getopt($usage, $p = array())
if ($longoptname || $shortoptname)
{
if ($longoptname && ($shortoptname || $shortoptname === "0"))
+ {
+ if ($alias[$shortoptname])
+ it::error("getopt: short option -$shortoptname is used twice: --{$alias[$shortoptname]} and --$longoptname!");
$alias[$shortoptname] = $longoptname;
+ }
$witharg[$longoptname ? $longoptname : $shortoptname] = $longoptarg || $shortoptarg;
}