Allow domain to be passed to tag:visits, visit:orphan and visit:non-orphan commands

This commit is contained in:
Alejandro Celaya
2025-10-29 08:42:34 +01:00
parent 14a7e3bb05
commit 70e376d569
4 changed files with 76 additions and 3 deletions

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\CLI\Input;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
final readonly class DomainOption
{
private const string NAME = 'domain';
public function __construct(Command $command, string $description)
{
$command->addOption(
name: self::NAME,
shortcut: 'd',
mode: InputOption::VALUE_REQUIRED,
description: $description,
);
}
public function get(InputInterface $input): string|null
{
return $input->getOption(self::NAME);
}
}