From 9eccda510356b727d932ed3eb6bb4540720784c8 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 25 Apr 2019 12:50:02 +0200 Subject: [PATCH] add --short option to simplify the output --- src/Deblan/Command/CheckCommand.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Deblan/Command/CheckCommand.php b/src/Deblan/Command/CheckCommand.php index e791171..8f478a6 100644 --- a/src/Deblan/Command/CheckCommand.php +++ b/src/Deblan/Command/CheckCommand.php @@ -9,6 +9,7 @@ use Symfony\Component\Console\Command\Command as BaseCommand; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Process\Process; use Deblan\Whois\Parser; +use Symfony\Component\Console\Input\InputOption; /** * class CheckCommand. @@ -45,6 +46,7 @@ class CheckCommand extends BaseCommand $this ->setName('check') ->addArgument('domains', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'List of domains.') + ->addOption('short', 's', InputOption::VALUE_NONE, 'Simplify the output.') ->setHelp(<<<'EOF' The %command.name% retrieves the expiration dates of the given domains. @@ -66,6 +68,10 @@ EOF $table = new Table($output); $table->setHeaders(['Domain', 'Date']); + if ($this->input->getOption('short')) { + $table->setStyle('compact'); + } + foreach ($this->sort($this->successes) as $result) { $table->addRow([ $result['domain'],