]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Minor, improve behavior of arc get-config.
authorepriestley <git@epriestley.com>
Thu, 26 Jul 2012 03:14:28 +0000 (20:14 -0700)
committerepriestley <git@epriestley.com>
Thu, 26 Jul 2012 03:14:38 +0000 (20:14 -0700)
src/workflow/ArcanistGetConfigWorkflow.php

index 9d7ad1430ae043704132eaa6c76dbd8b74ce49f7..7ea20d69ee18f683fa1cbaa812d30c9c458c384f 100644 (file)
@@ -60,6 +60,7 @@ EOTEXT
       'project' => $this->getWorkingCopy()->getProjectConfig(),
       'local'   => $this->readLocalArcConfig(),
     );
+
     if ($argv) {
       $keys = $argv;
     } else {
@@ -68,17 +69,31 @@ EOTEXT
       sort($keys);
     }
 
+    $multi = (count($keys) > 1);
+
     foreach ($keys as $key) {
-      echo "{$key}\n";
+      if ($multi) {
+        echo "{$key}\n";
+      }
       foreach ($configs as $name => $config) {
-        $val = idx($config, $key);
+        switch ($name) {
+          case 'project':
+            // Respect older names in project config.
+            $val = $this->getWorkingCopy()->getConfig($key);
+            break;
+          default:
+            $val = idx($config, $key);
+            break;
+        }
         if ($val === null) {
           continue;
         }
         $val = $settings->formatConfigValueForDisplay($key, $val);
         printf("% 10.10s: %s\n", $name, $val);
       }
-      echo "\n";
+      if ($multi) {
+        echo "\n";
+      }
     }
 
     return 0;