arguments.php
private function parseArgument(&$arguments)
    {
        $argument = array_shift($arguments);
        if (preg_match('/^-(\w)=(.+)$/', $argument, $matches)) {
            return array($matches[1], $matches[2]);
        } elseif (preg_match('/^-(\w)$/', $argument, $matches)) {
            return array($matches[1], $this->nextNonFlagElseTrue($arguments));
        } elseif (preg_match('/^--(\w+)=(.+)$/', $argument, $matches)) {
            return array($matches[1], $matches[2]);
        } elseif (preg_match('/^--(\w+)$/', $argument, $matches)) {
            return array($matches[1], $this->nextNonFlagElseTrue($arguments));
        }
    }
private function parseArgument(&$arguments)
    {
        $argument = array_shift($arguments);
        if (preg_match('/^-(\w)=(.+)$/', $argument, $matches)) {
            return array($matches[1], $matches[2]);
        } elseif (preg_match('/^-(\w)$/', $argument, $matches)) {
            return array($matches[1], $this->nextNonFlagElseTrue($arguments));
        } elseif (preg_match('/^--(\w+)=(.+)$/', $argument, $matches)) {
            return array($matches[1], $matches[2]);
        } elseif (preg_match('/^--(\w+)$/', $argument, $matches)) {
            return array($matches[1], $this->nextNonFlagElseTrue($arguments));
        }
    }
private function parseArgument ( & $ arguments ) { $ argument = array_shift ( $ arguments ) ; if ( preg_match ( '/^-(\w)=(.+)$/' , $ argument , $ matches ) ) { return array ( $ matches [ 1 ] , $ matches [ 2 ] ) ; } elseif ( preg_match ( '/^-(\w)$/' , $ argument , $ matches ) ) { return array ( $ matches [ 1 ] , $ this -> nextNonFlagElseTrue ( $ arguments ) ) ; } elseif ( preg_match ( '/^--(\w+)=(.+)$/' , $ argument , $ matches ) ) { return array ( $ matches [ 1 ] , $ matches [ 2 ] ) ; } elseif ( preg_match ( '/^--(\w+)$/' , $ argument , $ matches ) ) { return array ( $ matches [ 1 ] , $ this -> nextNonFlagElseTrue ( $ arguments ) ) ; } }
Extracts the next key and value from the argument list.

@param array $arguments The remaining arguments to be parsed.
The argument list will be reduced.

@return array Two item array of key and value.
If no value can be found it will
have the value true assigned instead.
Extracts the next key and value from the argument list .