1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42:41 +01:00

Show current config and source using arc set-config --show

Summary:
`arc set-config --show` only show the user config
It would be better to contain local/global/system config

Test Plan: set config by local/global/system/user/project, and check the result of `arc set-config --show`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: epriestley

CC: epriestley, aran

Differential Revision: https://secure.phabricator.com/D7851
This commit is contained in:
iodragon 2014-01-02 12:07:03 -08:00 committed by epriestley
parent 739881a3f4
commit 6769c6b17c

View file

@ -125,7 +125,7 @@ EOTEXT
}
private function show() {
$config = $this->getConfigurationManager()->readUserArcConfig();
$config_manager = $this->getConfigurationManager();
$settings = new ArcanistSettings();
@ -136,7 +136,11 @@ EOTEXT
$example = $settings->getExample($key);
$help = $settings->getHelp($key);
$value = idx($config, $key);
$config = $config_manager->getConfigFromAllSources($key);
$source = head_key($config);
$value = head($config);
$value = $settings->formatConfigValueForDisplay($key, $value);
echo phutil_console_format("**__%s__** (%s)\n\n", $key, $type);
@ -144,7 +148,13 @@ EOTEXT
echo phutil_console_format(" Example: %s\n", $example);
}
if (strlen($value)) {
echo phutil_console_format(" User Setting: %s\n", $value);
if (strlen($source)) {
$source = pht('(from %s config)', $source);
}
echo phutil_console_format(
" Current Setting: %s %s\n",
$value,
$source);
}
echo "\n";
echo phutil_console_wrap($help, 4);