summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Gass2012-05-07 13:10:17 +0000
committerNathan Gass2012-05-07 13:10:17 +0000
commit3b876e6feff6b67290e69ec64704468f74c573e3 (patch)
tree647b355b253743568a4c27f6099721cf9c5f2f25
parent9c523156bbc9d34ff2a16ec3b2c345951fc55287 (diff)
downloaditools-3b876e6feff6b67290e69ec64704468f74c573e3.tar.gz
itools-3b876e6feff6b67290e69ec64704468f74c573e3.tar.bz2
itools-3b876e6feff6b67290e69ec64704468f74c573e3.zip
handle -- to stop option parsing
-rw-r--r--it.class6
1 files changed, 5 insertions, 1 deletions
diff --git a/it.class b/it.class
index 407e200..d2ac013 100644
--- a/it.class
+++ b/it.class
@@ -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;