diff options
author | Urban Müller | 2021-06-15 16:57:36 +0200 |
---|---|---|
committer | Urban Müller | 2021-06-15 16:57:47 +0200 |
commit | 5aef64122fbb5a5855af095206bd642ca08cca61 (patch) | |
tree | 7e58360b7273d02c3d8e6ef2be78da60926d4464 /it.class | |
parent | bb27969a215de7f0091f8bd1f63a74107dbb3a1e (diff) | |
download | itools-5aef64122fbb5a5855af095206bd642ca08cca61.tar.gz itools-5aef64122fbb5a5855af095206bd642ca08cca61.tar.bz2 itools-5aef64122fbb5a5855af095206bd642ca08cca61.zip |
allow leading - in ::getopt option arguments, add tests
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -901,12 +901,7 @@ static function getopt($usage, $p = array()) foreach (array_slice($_SERVER['argv'], 1) as $arg) { if ($eat) - { - if (it::match('^--?\w', $arg)) # Already next option => Missing argument? - $err = true; - else - $result[array_shift($eat)] = $arg; - } + $result[array_shift($eat)] = $arg; else if ($arg == "--") $noopts = true; else if (!$noopts && ($matches = (array)it::match('^--(\w[\w-]*)(=.*)?', $arg))) |