From 1040046f3a8e0338396b23005cee5e914544177b Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 16 Feb 2011 10:07:48 -0800 Subject: [PATCH] Support --load-phutil-library in arcanist. Summary: Test Plan: Reviewers: CC: --- scripts/arcanist.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/arcanist.php b/scripts/arcanist.php index 6f1265ba..99af52e8 100755 --- a/scripts/arcanist.php +++ b/scripts/arcanist.php @@ -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) {