Changeset View
Changeset View
Standalone View
Standalone View
support/ArcanistRuntime.php
Show All 39 Lines | $config_args = array( | ||||
'repeat' => true, | 'repeat' => true, | ||||
), | ), | ||||
array( | array( | ||||
'name' => 'config', | 'name' => 'config', | ||||
'param' => 'key=value', | 'param' => 'key=value', | ||||
'repeat' => true, | 'repeat' => true, | ||||
'help' => pht('Specify a runtime configuration value.'), | 'help' => pht('Specify a runtime configuration value.'), | ||||
), | ), | ||||
array( | |||||
'name' => 'config-file', | |||||
'param' => 'path', | |||||
'repeat' => true, | |||||
'help' => pht( | |||||
'Load one or more configuration files. If this flag is provided, '. | |||||
'the system and user configuration files are ignored.'), | |||||
), | |||||
); | ); | ||||
$args = id(new PhutilArgumentParser($argv)) | $args = id(new PhutilArgumentParser($argv)) | ||||
->parseStandardArguments(); | ->parseStandardArguments(); | ||||
$is_trace = $args->getArg('trace'); | $is_trace = $args->getArg('trace'); | ||||
if ($is_trace) { | if ($is_trace) { | ||||
$this->logTrace(pht('ARGV'), csprintf('%Ls', $argv)); | $this->logTrace(pht('ARGV'), csprintf('%Ls', $argv)); | ||||
▲ Show 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | if ($problems) { | ||||
} | } | ||||
$problems = implode("\n\n", $problems); | $problems = implode("\n\n", $problems); | ||||
throw new Exception($problems); | throw new Exception($problems); | ||||
} | } | ||||
} | } | ||||
private function loadConfiguration(PhutilArgumentParser $args) { | private function loadConfiguration(PhutilArgumentParser $args) { | ||||
$engine = new ArcanistConfigurationEngine(); | $engine = id(new ArcanistConfigurationEngine()) | ||||
->setArguments($args); | |||||
$working_copy = ArcanistWorkingCopyIdentity::newFromPath(getcwd()); | $working_copy = ArcanistWorkingCopy::newFromWorkingDirectory(getcwd()); | ||||
if ($working_copy) { | if ($working_copy) { | ||||
$engine->setWorkingCopy($working_copy); | $engine->setWorkingCopy($working_copy); | ||||
} | } | ||||
return $engine->newConfigurationSourceList(); | return $engine->newConfigurationSourceList(); | ||||
} | } | ||||
private function loadLibraries( | private function loadLibraries( | ||||
PhutilArgumentParser $args, | PhutilArgumentParser $args, | ||||
ArcanistConfigurationManager $config) { | ArcanistConfigurationSourceList $config) { | ||||
$is_trace = $args->getArg('trace'); | // TOOLSETS: Make this work again -- or replace it entirely with package | ||||
// management? | |||||
if ($is_trace) { | return; | ||||
$libraries = array( | |||||
'phutil', | |||||
'arcanist', | |||||
); | |||||
foreach ($libraries as $library_name) { | $is_trace = $args->getArg('trace'); | ||||
$this->logTrace( | |||||
pht('LOAD'), | |||||
pht( | |||||
'Loaded "%s" from "%s".', | |||||
$library_name, | |||||
phutil_get_library_root($library_name))); | |||||
} | |||||
} | |||||
$load = array(); | $load = array(); | ||||
$working_copy = $config->getWorkingCopyIdentity(); | $working_copy = $this->getWorkingCopy(); | ||||
$cli_libraries = $args->getArg('library'); | $cli_libraries = $args->getArg('library'); | ||||
if ($cli_libraries) { | if ($cli_libraries) { | ||||
$load[] = array( | $load[] = array( | ||||
'--library', | '--library', | ||||
$cli_libraries, | $cli_libraries, | ||||
); | ); | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 211 Lines • ▼ Show 20 Lines | private function newWorkflows(ArcanistToolset $toolset) { | ||||
} | } | ||||
return $map; | return $map; | ||||
} | } | ||||
private function resolveAliases( | private function resolveAliases( | ||||
array $workflows, | array $workflows, | ||||
array $argv, | array $argv, | ||||
ArcanistConfigurationManager $config) { | ArcanistConfigurationSourceList $config) { | ||||
$command = head($argv); | $command = head($argv); | ||||
// If this is a match for a recognized workflow, just return the arguments | // If this is a match for a recognized workflow, just return the arguments | ||||
// unmodified. You aren't allowed to alias over real workflows. | // unmodified. You aren't allowed to alias over real workflows. | ||||
if (isset($workflows[$command])) { | if (isset($workflows[$command])) { | ||||
return $argv; | return $argv; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |