add --short option to simplify the output
This commit is contained in:
parent
55d56ad9f0
commit
9eccda5103
|
@ -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'],
|
||||
|
|
Loading…
Reference in New Issue