src/Console/Option/OptionParser.php
protected function preprocessingArguments(array $argv)
    {
        // preprocessing arguments
        $newArgv = [];
        $extra = [];
        $afterDash = false;
        foreach ($argv as $arg) {
            if ($arg === '--') {
                $afterDash = true;
                continue;
            }
            if ($afterDash) {
                $extra[] = $arg;
                continue;
            }

            $a = new Argument($arg);
            if ($a->anyOfOptions($this->specs) && $a->containsOptionValue()) {
                list($opt, $val) = $a->splitAsOption();
                array_push($newArgv, $opt, $val);
            } else {
                $newArgv[] = $arg;
            }
        }

        return [$newArgv, $extra];
    }
protected function preprocessingArguments(array $argv)
    {
        // preprocessing arguments
        $newArgv = [];
        $extra = [];
        $afterDash = false;
        foreach ($argv as $arg) {
            if ($arg === '--') {
                $afterDash = true;
                continue;
            }
            if ($afterDash) {
                $extra[] = $arg;
                continue;
            }

            $a = new Argument($arg);
            if ($a->anyOfOptions($this->specs) && $a->containsOptionValue()) {
                list($opt, $val) = $a->splitAsOption();
                array_push($newArgv, $opt, $val);
            } else {
                $newArgv[] = $arg;
            }
        }

        return [$newArgv, $extra];
    }
protected function preprocessingArguments ( array $ argv ) { // preprocessing arguments $ newArgv = [ ] ; $ extra = [ ] ; $ afterDash = false ; foreach ( $ argv as $ arg ) { if ( $ arg === '--' ) { $ afterDash = true ; continue ; } if ( $ afterDash ) { $ extra [ ] = $ arg ; continue ; } $ a = new Argument ( $ arg ) ; if ( $ a -> anyOfOptions ( $ this -> specs ) && $ a -> containsOptionValue ( ) ) { list ( $ opt , $ val ) = $ a -> splitAsOption ( ) ; array_push ( $ newArgv , $ opt , $ val ) ; } else { $ newArgv [ ] = $ arg ; } } return [ $ newArgv , $ extra ] ; }
preprocess the argv array

- split option and option value
- separate arguments after "--"
preprocess the argv array