Use json_pretty as default for the config lists (for easier export/import)

This commit is contained in:
Joas Schilling 2015-07-16 17:51:33 +02:00
parent bfb90d10ed
commit d5dcb60e5d
2 changed files with 5 additions and 6 deletions

View File

@ -27,6 +27,8 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
class Base extends Command { class Base extends Command {
protected $defaultOutputFormat = 'plain';
protected function configure() { protected function configure() {
$this $this
->addOption( ->addOption(
@ -34,7 +36,7 @@ class Base extends Command {
null, null,
InputOption::VALUE_OPTIONAL, InputOption::VALUE_OPTIONAL,
'Output format (plain, json or json_pretty, default is plain)', 'Output format (plain, json or json_pretty, default is plain)',
'plain' $this->defaultOutputFormat
) )
; ;
} }

View File

@ -30,6 +30,8 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
class ListConfigs extends Base { class ListConfigs extends Base {
protected $defaultOutputFormat = 'json_pretty';
/** @var array */ /** @var array */
protected $sensitiveValues = [ protected $sensitiveValues = [
'dbpassword', 'dbpassword',
@ -81,11 +83,6 @@ class ListConfigs extends Base {
$app = $input->getArgument('app'); $app = $input->getArgument('app');
$noSensitiveValues = !$input->getOption('private'); $noSensitiveValues = !$input->getOption('private');
if ($noSensitiveValues && !$input->hasParameterOption('--output')) {
// If you post this publicly we prefer the json format
$input->setOption('output', 'json_pretty');
}
switch ($app) { switch ($app) {
case 'system': case 'system':
$configs = [ $configs = [