show all available config settings if configkey is missing
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 17 Apr 2014 18:04:13 +0000 (20:04 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 22 Apr 2014 08:01:18 +0000 (10:01 +0200)
Change-Id: I27acfe352dcd8e39a9459a7e4f8e4d0fbd49c078
Reviewed-on: http://gerrit.tine20.com/customers/544
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Setup/Frontend/Cli.php

index 8d829e5..3ab8988 100644 (file)
@@ -412,15 +412,19 @@ class Setup_Frontend_Cli
     protected function _getConfig(Zend_Console_Getopt $_opts)
     {
         $options = $this->_parseRemainingArgs($_opts->getRemainingArgs());
+        $applicationName = (isset($options['app'])) ? $options['app'] : 'Tinebase';
+        $config = Tinebase_Config_Abstract::factory($applicationName);
+        
         $errors = array();
         if (empty($options['configkey'])) {
             $errors[] = 'Missing argument: configkey';
+            $errors[] = 'Available config settings:';
+            $errors[] = print_r($config::getProperties(), true);
         }
         $configKey = (string)$options['configkey'];
-        $applicationName = (isset($options['app'])) ? $options['app'] : 'Tinebase';
         
         if (empty($errors)) {
-            $value = Tinebase_Config_Abstract::factory($applicationName)->get($configKey);
+            $value = $config->get($configKey);
             $value = is_string($value) ? $value : Zend_Json::encode($value);
             echo $value . " \n";
         } else {