mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-02 23:07:39 +02:00
[ticket/12039] Allow getting the value without a new line at the end
PHPBB3-12039
This commit is contained in:
@@ -25,6 +25,12 @@ class get extends command
|
|||||||
InputArgument::REQUIRED,
|
InputArgument::REQUIRED,
|
||||||
"The configuration option's name"
|
"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');
|
$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]);
|
$output->writeln($this->config[$key]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user