Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14089717
D9442.id22780.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9442.id22780.diff
View Options
diff --git a/scripts/arcanist.php b/scripts/arcanist.php
--- a/scripts/arcanist.php
+++ b/scripts/arcanist.php
@@ -165,6 +165,7 @@
$workflow->setCommand($command);
$workflow->setWorkingDirectory($working_directory);
$workflow->parseArguments($args);
+ $workflow->applyRuntimeConfiguration();
// Write the command into the environment so that scripts (for example, local
// Git commit hooks) can detect that they're being run via `arc` and change
diff --git a/src/workflow/ArcanistBaseWorkflow.php b/src/workflow/ArcanistBaseWorkflow.php
--- a/src/workflow/ArcanistBaseWorkflow.php
+++ b/src/workflow/ArcanistBaseWorkflow.php
@@ -606,9 +606,32 @@
$arc_config = $this->getArcanistConfiguration();
$command = $this->getCommand();
$spec += $arc_config->getCustomArgumentsForCommand($command);
+ $spec += $this->getGlobalArguments();
+
return $spec;
}
+ final function getGlobalArguments() {
+ return array(
+ 'config' => array(
+ 'param' => 'key=value',
+ 'repeat' => true,
+ 'help' =>
+ 'Specify a configuration value for the duration of this command',
+ ),
+ );
+ }
+
+ final public function applyRuntimeConfiguration() {
+ $options = $this->getArgument('config');
+ $manager = $this->getConfigurationManager();
+
+ foreach ($options as $opt) {
+ list($key, $value) = preg_split('/=/', $opt, 2);
+ $manager->setRuntimeConfig($key, $value);
+ }
+ }
+
final public function parseArguments(array $args) {
$this->passedArguments = $args;
diff --git a/src/workflow/ArcanistHelpWorkflow.php b/src/workflow/ArcanistHelpWorkflow.php
--- a/src/workflow/ArcanistHelpWorkflow.php
+++ b/src/workflow/ArcanistHelpWorkflow.php
@@ -63,6 +63,7 @@
}
$optref = array();
$arguments = $workflow->getArguments();
+ $arguments += $workflow->getGlobalArguments();
$config_arguments = $arc_config->getCustomArgumentsForCommand($command);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 12:48 PM (20 h, 47 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6785936
Default Alt Text
D9442.id22780.diff (1 KB)
Attached To
Mode
D9442: Allow specifying runtime configuration with --set-config key=value
Attached
Detach File
Event Timeline
Log In to Comment