]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Support --load-phutil-library in arcanist.
authorepriestley <epriestley@javelinjs.com>
Wed, 16 Feb 2011 18:07:48 +0000 (10:07 -0800)
committerepriestley <epriestley@javelinjs.com>
Wed, 16 Feb 2011 18:07:48 +0000 (10:07 -0800)
Summary:

Test Plan:

Reviewers:

CC:

scripts/arcanist.php

index 6f1265ba4c0ff9e3a3ab07404c3a64d1b58de7ab..99af52e88ce939f946b91ec34b9403c900ba07a2 100755 (executable)
@@ -32,12 +32,17 @@ phutil_require_module('arcanist', 'repository/api/base');
 
 $config_trace_mode = false;
 $args = array_slice($argv, 1);
+$load = array();
+$matches = null;
 foreach ($args as $key => $arg) {
   if ($arg == '--') {
     break;
   } else if ($arg == '--trace') {
     unset($args[$key]);
     $config_trace_mode = true;
+  } else if (preg_match('/^--load-phutil-library=(.*)$/', $arg, $matches)) {
+    unset($args[$key]);
+    $load['?'] = $matches[1];
   }
 }
 
@@ -54,7 +59,11 @@ try {
   }
 
   $working_copy = ArcanistWorkingCopyIdentity::newFromPath($_SERVER['PWD']);
-  $libs = $working_copy->getConfig('phutil_libraries');
+  if ($load) {
+    $libs = $load;
+  } else {
+    $libs = $working_copy->getConfig('phutil_libraries');
+  }
   if ($libs) {
     foreach ($libs as $name => $location) {
       if ($config_trace_mode) {