diff --git a/CHANGELOG.md b/CHANGELOG.md index 61e3a31a..a63660aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this * [#2517](https://github.com/shlinkio/shlink/issues/2517) Remove `REDIRECT_APPEND_EXTRA_PATH` env var. Use `REDIRECT_EXTRA_PATH_MODE=append` instead. * [#2519](https://github.com/shlinkio/shlink/issues/2519) Disabling API keys by their plain-text key is no longer supported. When calling `api-key:disable`, the first argument is now always assumed to be the name. * [#2520](https://github.com/shlinkio/shlink/issues/2520) Remove deprecated `--including-all-tags` and `--show-api-key-name` deprecated options from `short-url:list` command. Use `--tags-all` and `--show-api-key` instead. +* [#2521](https://github.com/shlinkio/shlink/issues/2521) Remove deprecated `--tags` option in all commands using it. Use `--tag` multiple times instead, one per tag. ### Fixed * *Nothing* diff --git a/module/CLI/src/Command/ShortUrl/ListShortUrlsCommand.php b/module/CLI/src/Command/ShortUrl/ListShortUrlsCommand.php index c1c5df4f..99c445f0 100644 --- a/module/CLI/src/Command/ShortUrl/ListShortUrlsCommand.php +++ b/module/CLI/src/Command/ShortUrl/ListShortUrlsCommand.php @@ -76,7 +76,7 @@ class ListShortUrlsCommand extends Command ->addOption( 'tags-all', mode: InputOption::VALUE_NONE, - description: 'If --tags is provided, returns only short URLs including ALL of them', + description: 'If --tag is provided, returns only short URLs including ALL of them', ) ->addOption( 'exclude-tag', diff --git a/module/CLI/src/Input/TagsOption.php b/module/CLI/src/Input/TagsOption.php index ff02a735..1cdee7e8 100644 --- a/module/CLI/src/Input/TagsOption.php +++ b/module/CLI/src/Input/TagsOption.php @@ -8,10 +8,7 @@ use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; -use function array_map; use function array_unique; -use function Shlinkio\Shlink\Core\ArrayUtils\flatten; -use function Shlinkio\Shlink\Core\splitByComma; readonly class TagsOption { @@ -23,20 +20,15 @@ readonly class TagsOption 't', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, $description, - ) - ->addOption( - 'tags', - mode: InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, - description: '[DEPRECATED] Use --tag instead', ); } /** - * Whether tags have been set or not, via `--tag`, `-t` or the deprecated `--tags` + * Whether tags have been set or not, via `--tag` or `-t` */ public function exists(InputInterface $input): bool { - return $input->hasParameterOption(['--tag', '-t']) || $input->hasParameterOption('--tags'); + return $input->hasParameterOption(['--tag', '-t']); } /** @@ -44,8 +36,6 @@ readonly class TagsOption */ public function get(InputInterface $input): array { - // FIXME DEPRECATED Remove support for comma-separated tags in next major release - $tags = [...$input->getOption('tag'), ...$input->getOption('tags')]; - return array_unique(flatten(array_map(splitByComma(...), $tags))); + return array_unique($input->getOption('tag')); } } diff --git a/module/CLI/test/Command/ShortUrl/CreateShortUrlCommandTest.php b/module/CLI/test/Command/ShortUrl/CreateShortUrlCommandTest.php index 728f8f22..ff5e3ea6 100644 --- a/module/CLI/test/Command/ShortUrl/CreateShortUrlCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/CreateShortUrlCommandTest.php @@ -95,7 +95,7 @@ class CreateShortUrlCommandTest extends TestCase $this->commandTester->execute([ 'longUrl' => 'http://domain.com/foo/bar', - '--tags' => ['foo,bar', 'baz', 'boo,zar,baz'], + '--tag' => ['foo', 'bar', 'baz', 'boo', 'zar', 'baz'], ]); $output = $this->commandTester->getDisplay();