mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 23:02:41 +01:00
Minor, improve behavior of arc get-config.
This commit is contained in:
parent
8e00d3cfaf
commit
8d9e1d8479
1 changed files with 18 additions and 3 deletions
|
@ -60,6 +60,7 @@ EOTEXT
|
||||||
'project' => $this->getWorkingCopy()->getProjectConfig(),
|
'project' => $this->getWorkingCopy()->getProjectConfig(),
|
||||||
'local' => $this->readLocalArcConfig(),
|
'local' => $this->readLocalArcConfig(),
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($argv) {
|
if ($argv) {
|
||||||
$keys = $argv;
|
$keys = $argv;
|
||||||
} else {
|
} else {
|
||||||
|
@ -68,17 +69,31 @@ EOTEXT
|
||||||
sort($keys);
|
sort($keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$multi = (count($keys) > 1);
|
||||||
|
|
||||||
foreach ($keys as $key) {
|
foreach ($keys as $key) {
|
||||||
echo "{$key}\n";
|
if ($multi) {
|
||||||
|
echo "{$key}\n";
|
||||||
|
}
|
||||||
foreach ($configs as $name => $config) {
|
foreach ($configs as $name => $config) {
|
||||||
$val = idx($config, $key);
|
switch ($name) {
|
||||||
|
case 'project':
|
||||||
|
// Respect older names in project config.
|
||||||
|
$val = $this->getWorkingCopy()->getConfig($key);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$val = idx($config, $key);
|
||||||
|
break;
|
||||||
|
}
|
||||||
if ($val === null) {
|
if ($val === null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$val = $settings->formatConfigValueForDisplay($key, $val);
|
$val = $settings->formatConfigValueForDisplay($key, $val);
|
||||||
printf("% 10.10s: %s\n", $name, $val);
|
printf("% 10.10s: %s\n", $name, $val);
|
||||||
}
|
}
|
||||||
echo "\n";
|
if ($multi) {
|
||||||
|
echo "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue