protected function execute(InputInterface $input, OutputInterface $output)
{
$this->handler = new CompletionHandler($this->getApplication());
$handler = $this->handler;
if ($input->getOption('generate-hook')) {
global $argv;
$program = $argv[0];
$factory = new HookFactory();
$alias = $input->getOption('program');
$multiple = (bool) $input->getOption('multiple');
if (!$alias) {
$alias = basename($program);
}
$hook = $factory->generateHook($input->getOption('shell-type') ?: $this->getShellType(), $program, $alias, $multiple);
$output->write($hook, true);
} else {
$handler->setContext(new EnvironmentCompletionContext());
$output->write($this->runCompletion(), true);
}
}