add --short option to simplify the output

This commit is contained in:
Simon Vieille 2019-04-25 12:50:02 +02:00
parent 55d56ad9f0
commit 9eccda5103
Signed by: deblan
GPG Key ID: 03383D15A1D31745
1 changed files with 6 additions and 0 deletions

View File

@ -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 <info>%command.name%</info> 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'],