From 5de845c2585f240348bc2237ec8bd7eeaf6c9fba Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Thu, 28 Dec 2017 15:17:12 +0100 Subject: [PATCH] Improved GenerateSecretCommand by using SymfonyStyle --- module/CLI/src/Command/Config/GenerateSecretCommand.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/CLI/src/Command/Config/GenerateSecretCommand.php b/module/CLI/src/Command/Config/GenerateSecretCommand.php index 685ab4c5..684d6c8f 100644 --- a/module/CLI/src/Command/Config/GenerateSecretCommand.php +++ b/module/CLI/src/Command/Config/GenerateSecretCommand.php @@ -7,6 +7,7 @@ use Shlinkio\Shlink\Common\Util\StringUtilsTrait; 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 GenerateSecretCommand extends Command @@ -37,6 +38,8 @@ class GenerateSecretCommand extends Command public function execute(InputInterface $input, OutputInterface $output) { $secret = $this->generateRandomString(32); - $output->writeln($this->translator->translate('Secret key:') . sprintf(' %s', $secret)); + (new SymfonyStyle($input, $output))->success( + sprintf($this->translator->translate('Secret key: "%s"'), $secret) + ); } }