protected static function parseShortOption($arg, $short_options, &$opts, &$args) {
$argLen = strlen($arg);
for ($i = 0; $i < $argLen; $i++) {
$opt = $arg[$i];
$opt_arg = NULL;
if (($spec = strstr($short_options, $opt)) === FALSE || $arg[$i] == ':') {
throw new PHPUnit_Framework_Exception("unrecognized option -- {$opt}");
}
if (strlen($spec) > 1 && $spec[1] == ':') {
if (strlen($spec) > 2 && $spec[2] == ':') {
if ($i + 1 < $argLen) {
$opts[] = array(
$opt,
substr($arg, $i + 1),
);
break;
}
}
else {
if ($i + 1 < $argLen) {
$opts[] = array(
$opt,
substr($arg, $i + 1),
);
break;
}
else {
if (list(, $opt_arg) = each($args)) {
}
else {
throw new PHPUnit_Framework_Exception("option requires an argument -- {$opt}");
}
}
}
}
$opts[] = array(
$opt,
$opt_arg,
);
}
}