writeln('Has option 1: ' . ($input->getOption('option1') ? 'true' : 'false')); $output->writeln('option 2 value: ' . $input->getOption('option2')); return $this->exitCode; } public function setExitCode(int $code): void { $this->exitCode = $code; } public function getOptions(): array { return [ new InputOption('option1', null, InputOption::VALUE_NONE), new InputOption('option2', null, InputOption::VALUE_REQUIRED), ]; } }