From 3b876e6feff6b67290e69ec64704468f74c573e3 Mon Sep 17 00:00:00 2001 From: Nathan Gass Date: Mon, 7 May 2012 13:10:17 +0000 Subject: handle -- to stop option parsing --- it.class | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3