From a70973ea423fda2a26fc8ff17e6e9c33bee11547 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 9 Jan 2014 00:05:32 +0100 Subject: [PATCH] [ticket/12039] Allow getting the value without a new line at the end PHPBB3-12039 --- phpBB/phpbb/console/command/config/get.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/phpBB/phpbb/console/command/config/get.php b/phpBB/phpbb/console/command/config/get.php index 1f9781ea9c..275c82b53f 100644 --- a/phpBB/phpbb/console/command/config/get.php +++ b/phpBB/phpbb/console/command/config/get.php @@ -25,6 +25,12 @@ class get extends command InputArgument::REQUIRED, "The configuration option's name" ) + ->addOption( + 'no-newline', + null, + InputOption::VALUE_NONE, + 'Set this option if the value should be printed without a new line at the end.' + ) ; } @@ -32,7 +38,11 @@ class get extends command { $key = $input->getArgument('key'); - if (isset($this->config[$key])) + if (isset($this->config[$key]) && $input->getOption('no-newline')) + { + $output->write($this->config[$key]); + } + elseif (isset($this->config[$key])) { $output->writeln($this->config[$key]); }