From 1b94083188cfdf935c5296e005409b118f9997d5 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Thu, 28 Dec 2017 09:48:17 +0100 Subject: [PATCH] Improved GenerateCharsetCommand by using SymfonyStyle --- module/CLI/src/Command/Config/GenerateCharsetCommand.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/CLI/src/Command/Config/GenerateCharsetCommand.php b/module/CLI/src/Command/Config/GenerateCharsetCommand.php index d1a1b267..caa64c28 100644 --- a/module/CLI/src/Command/Config/GenerateCharsetCommand.php +++ b/module/CLI/src/Command/Config/GenerateCharsetCommand.php @@ -7,6 +7,7 @@ use Shlinkio\Shlink\Core\Service\UrlShortener; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; use Zend\I18n\Translator\TranslatorInterface; class GenerateCharsetCommand extends Command @@ -36,6 +37,8 @@ class GenerateCharsetCommand extends Command public function execute(InputInterface $input, OutputInterface $output) { $charSet = str_shuffle(UrlShortener::DEFAULT_CHARS); - $output->writeln($this->translator->translate('Character set:') . sprintf(' %s', $charSet)); + (new SymfonyStyle($input, $output))->success( + \sprintf($this->translator->translate('Character set: "%s"'), $charSet) + ); } }