/**
  * Run application.
  *
  * @param AbstractInput $input
  */
 public function run(AbstractInput $input)
 {
     try {
         if (null !== ($command = $input->getFirstArgument())) {
             $console = $this->getConsole($command);
         } else {
             $console = $this->getConsole('list');
         }
         try {
             if (null === $this->executor) {
                 $console->run($input);
             } else {
                 call_user_func($this->executor, $input, $console);
             }
         } catch (Exception $e) {
             if ($e instanceof ShowHelpException) {
                 $this->writeHelp($console);
             } else {
                 throw $e;
             }
         }
     } catch (Exception $e) {
         $this->writeException($e, new Output());
     }
 }