return "-$s";
}, str_split(substr($o, 1))));
$o = $argv[$i];
+ } elseif ($o{0} === '-' && strlen($o) > 2 && $o{1} === '-' && 0 < ($eq = strpos($o, "="))) {
+ $argc++;
+ array_splice($argv, $i, 1, [
+ substr($o, 0, $eq++),
+ substr($o, $eq)
+ ]);
+ $o = $argv[$i];
}
if (!isset($this->spec[$o])) {
}
$this->assertTrue(isset($error));
}
+
+ public function testLongEquals() {
+ $this->assertNull($this->args->configure);
+ foreach ($this->args->parse(1, ["--configure=--with-lib=/opt/lib"]) as $error) {
+ throw new \Exception("Unexpected parse error: $error");
+ }
+ $this->assertSame(["--with-lib=/opt/lib"], $this->args->configure);
+ }
public function testValidate() {
$this->args->compile([