summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class2
-rwxr-xr-xtest/it.t1
2 files changed, 2 insertions, 1 deletions
diff --git a/it.class b/it.class
index e2e1dd0..b98f531 100644
--- a/it.class
+++ b/it.class
@@ -950,7 +950,7 @@ static function getopt($usage, $p = array())
{
if ($eat)
$result[array_shift($eat)] = $arg;
- else if ($arg == "--")
+ else if (!$noopts && $arg == "--")
$noopts = true;
else if (!$noopts && ($matches = (array)it::match('^--(\w[\w-]*)(=.*)?', $arg)))
{
diff --git a/test/it.t b/test/it.t
index 3003ccf..992a81f 100755
--- a/test/it.t
+++ b/test/it.t
@@ -565,6 +565,7 @@ function requesturi($teststring, $expect)
_getopt(["val"], ['foo' => "val"]);
_getopt(["--", "-val"], ['foo' => "-val"]);
+_getopt(["--", "--"], ['foo' => "--"]);
_getopt(["-v", "val"], ['verbose' => true, 'foo' => "val"]);
_getopt(["--verbose", "val"], ['verbose' => true, 'foo' => "val"]);
_getopt(["-vw", "val"], ['verbose' => true, 'werbose' => true, 'foo' => "val"]);