From d5dcb60e5d796852cf62183c388605793bb89c09 Mon Sep 17 00:00:00 2001
From: Joas Schilling <nickvergessen@owncloud.com>
Date: Thu, 16 Jul 2015 17:51:33 +0200
Subject: [PATCH] Use json_pretty as default for the config lists (for easier
 export/import)

---
 core/command/base.php               | 4 +++-
 core/command/config/listconfigs.php | 7 ++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/core/command/base.php b/core/command/base.php
index 7e61c0cb9a..7936e683dc 100644
--- a/core/command/base.php
+++ b/core/command/base.php
@@ -27,6 +27,8 @@ use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Output\OutputInterface;
 
 class Base extends Command {
+	protected $defaultOutputFormat = 'plain';
+
 	protected function configure() {
 		$this
 			->addOption(
@@ -34,7 +36,7 @@ class Base extends Command {
 				null,
 				InputOption::VALUE_OPTIONAL,
 				'Output format (plain, json or json_pretty, default is plain)',
-				'plain'
+				$this->defaultOutputFormat
 			)
 		;
 	}
diff --git a/core/command/config/listconfigs.php b/core/command/config/listconfigs.php
index be3073e54d..d80bd2b98c 100644
--- a/core/command/config/listconfigs.php
+++ b/core/command/config/listconfigs.php
@@ -30,6 +30,8 @@ use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Output\OutputInterface;
 
 class ListConfigs extends Base {
+	protected $defaultOutputFormat = 'json_pretty';
+
 	/** @var array */
 	protected $sensitiveValues = [
 		'dbpassword',
@@ -81,11 +83,6 @@ class ListConfigs extends Base {
 		$app = $input->getArgument('app');
 		$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) {
 			case 'system':
 				$configs = [
-- 
GitLab