protected function runCommand($input)
    {
        $command = $this->getCommand($input);

        if (empty($command)) {
            throw new \InvalidArgumentException('Command not found: ' . $input);
        }

        $input = new ShellInput(\str_replace('\\', '\\\\', \rtrim($input, " \t\n\r\0\x0B;")));

        if ($input->hasParameterOption(['--help', '-h'])) {
            $helpCommand = $this->get('help');
            $helpCommand->setCommand($command);

            return $helpCommand->run($input, $this->output);
        }

        return $command->run($input, $this->output);
    }
protected function runCommand($input)
    {
        $command = $this->getCommand($input);

        if (empty($command)) {
            throw new \InvalidArgumentException('Command not found: ' . $input);
        }

        $input = new ShellInput(\str_replace('\\', '\\\\', \rtrim($input, " \t\n\r\0\x0B;")));

        if ($input->hasParameterOption(['--help', '-h'])) {
            $helpCommand = $this->get('help');
            $helpCommand->setCommand($command);

            return $helpCommand->run($input, $this->output);
        }

        return $command->run($input, $this->output);
    }
protected function runCommand ( $ input ) { $ command = $ this -> getCommand ( $ input ) ; if ( empty ( $ command ) ) { throw new \ InvalidArgumentException ( 'Command not found: ' . $ input ) ; } $ input = new ShellInput ( \ str_replace ( '\\' , '\\\\' , \ rtrim ( $ input , " \t\n\r\0\x0B;" ) ) ) ; if ( $ input -> hasParameterOption ( [ '--help' , '-h' ] ) ) { $ helpCommand = $ this -> get ( 'help' ) ; $ helpCommand -> setCommand ( $ command ) ; return $ helpCommand -> run ( $ input , $ this -> output ) ; } return $ command -> run ( $ input , $ this -> output ) ; }
Run a Psy Shell command given the user input.

@throws InvalidArgumentException if the input is not a valid command

@param string $input User input string

@return mixed Who knows?
Run a Psy Shell command given the user input .