setDescription('Receive version information') ->setHelp('This command allows you to fetch various version information about Kimai.') ->addOption('short', null, InputOption::VALUE_NONE, 'Display the version only') ->addOption('number', null, InputOption::VALUE_NONE, 'Display the version identifier only only') ; } protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); if ($input->getOption('short')) { $io->writeln(Constants::VERSION); return Command::SUCCESS; } if ($input->getOption('number')) { $io->writeln((string) Constants::VERSION_ID); return Command::SUCCESS; } $io->writeln(sprintf('%s %s by Kevin Papst.', Constants::SOFTWARE, Constants::VERSION)); return Command::SUCCESS; } }