From 5d9bf1534f8bd6e277f7f7e45310e028e3f2cca6 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 10 Mar 2020 14:21:04 +0100 Subject: handle = in short opts as well (-n=2) --- it.class | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3