diff options
author | Nathan Gass | 2012-05-07 13:10:17 +0000 |
---|---|---|
committer | Nathan Gass | 2012-05-07 13:10:17 +0000 |
commit | 3b876e6feff6b67290e69ec64704468f74c573e3 (patch) | |
tree | 647b355b253743568a4c27f6099721cf9c5f2f25 | |
parent | 9c523156bbc9d34ff2a16ec3b2c345951fc55287 (diff) | |
download | itools-3b876e6feff6b67290e69ec64704468f74c573e3.tar.gz itools-3b876e6feff6b67290e69ec64704468f74c573e3.tar.bz2 itools-3b876e6feff6b67290e69ec64704468f74c573e3.zip |
handle -- to stop option parsing
-rw-r--r-- | it.class | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -661,13 +661,17 @@ static function getopt($helplines) foreach (array_slice($_SERVER['argv'], 1) as $arg) { - if ($eat) + if ($noopts) + $result['args'][] = $arg; + else if ($eat) { if (it::match('^--?\w', $arg)) # Already next option => Missing argument? $err = true; else $result[array_shift($eat)] = $arg; } + else if ($arg == "--") + $noopts = true; elseif ($matches = (array)it::match('^--(\w[\w-]*)(=.*)?', $arg)) { list($optname, $val) = $matches; |