Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand::execute PHP Метод

execute() защищенный Метод

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    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);
        }
    }