/**
* {@inheritdoc}
*/
public function doRun(InputInterface $input, OutputInterface $output)
{
/* @var ArgsInput $input */
Assert::isInstanceOf($input, 'Webmozart\\Console\\Adapter\\ArgsInput');
$rawArgs = $input->getRawArgs();
$resolvedCommand = $this->adaptedApplication->resolveCommand($rawArgs);
// Add parsed Args to the adapter
$input = new ArgsInput($rawArgs, $resolvedCommand->getArgs());
// Don't use $this->get() as get() does not work for sub-commands
$this->currentCommand = new CommandAdapter($resolvedCommand->getCommand(), $this);
try {
$result = parent::doRun($input, $output);
$this->currentCommand = null;
} catch (Exception $e) {
$this->currentCommand = null;
throw $e;
}
return $result;
}