protected function execute(InputInterface $input, OutputInterface $output) { $options = $input->getOptions(); if (!empty($options)) { $output->writeln('Options passed in command line:'); foreach ($options as $key => $value) { $output->writeln($key . ' => ' . $value); } } else { $output->writeln('No options passed in command line!'); } }
protected function execute(InputInterface $input, OutputInterface $output) { if ($input->hasOption('verbose')) { $output->writeln('Verbose option was passed in command line!'); } else { $output->writeln('Verbose option was not passed in command line!'); } }The package library for this is Symfony\Component\Console.