public function parse(array $argv): Command
    {
        $this->argv = $argv;

        $command = $this->commandFor($argv);
        $aliases = $this->aliasesFor($command);

        // Eat the cmd name!
        foreach ($argv as $i => $arg) {
            if (\in_array($arg, $aliases)) {
                unset($argv[$i]);

                break;
            }

            if ($arg[0] === '-') {
                break;
            }
        }

        return $command->parse($argv);
    }
public function parse(array $argv): Command
    {
        $this->argv = $argv;

        $command = $this->commandFor($argv);
        $aliases = $this->aliasesFor($command);

        // Eat the cmd name!
        foreach ($argv as $i => $arg) {
            if (\in_array($arg, $aliases)) {
                unset($argv[$i]);

                break;
            }

            if ($arg[0] === '-') {
                break;
            }
        }

        return $command->parse($argv);
    }
public function parse ( array $ argv ) : Command { $ this -> argv = $ argv ; $ command = $ this -> commandFor ( $ argv ) ; $ aliases = $ this -> aliasesFor ( $ command ) ; // Eat the cmd name! foreach ( $ argv as $ i => $ arg ) { if ( \ in_array ( $ arg , $ aliases ) ) { unset ( $ argv [ $ i ] ) ; break ; } if ( $ arg [ 0 ] === '-' ) { break ; } } return $ command -> parse ( $ argv ) ; }
Parse the arguments via the matching command but dont execute action..

@param array $argv Cli arguments/options.

@return Command The matched and parsed command (or default)
Parse the arguments via the matching command but dont execute action ..