summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2020-03-10 14:21:04 +0100
committerUrban Müller2020-03-10 14:21:04 +0100
commit5d9bf1534f8bd6e277f7f7e45310e028e3f2cca6 (patch)
treecf560349902e3861cb1acf27691e84e62c308ba1
parent61f113ed37870a1d5865b5bd0ba09ed1b7f4e415 (diff)
downloaditools-5d9bf1534f8bd6e277f7f7e45310e028e3f2cca6.tar.gz
itools-5d9bf1534f8bd6e277f7f7e45310e028e3f2cca6.tar.bz2
itools-5d9bf1534f8bd6e277f7f7e45310e028e3f2cca6.zip
handle = in short opts as well (-n=2)
-rw-r--r--it.class4
1 files changed, 3 insertions, 1 deletions
diff --git a/it.class b/it.class
index 41b9eb7..dabf74c 100644
--- a/it.class
+++ b/it.class
@@ -903,7 +903,9 @@ static function getopt($usage, $p = array())
foreach (explode("\n", trim(chunk_split($letters, 1, "\n"))) as $letter)
{
$optname = $alias[$letter] ? $alias[$letter] : $letter;
- if ($witharg[$optname])
+ if ($witharg[$optname] && it::match('=', $arg))
+ $result[$optname] = it::match('=(.*)', $arg);
+ else if ($witharg[$optname])
$eat[] = $optname;
else if (!isset($witharg[$optname]))
$err = true;