Changeset View
Changeset View
Standalone View
Standalone View
src/configuration/ArcanistSettings.php
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | return array( | ||||
'working directory when requiring a clean working copy. This option '. | 'working directory when requiring a clean working copy. This option '. | ||||
'should only be used when users understand how to restore their '. | 'should only be used when users understand how to restore their '. | ||||
'working directory from the local stash if an Arcanist operation '. | 'working directory from the local stash if an Arcanist operation '. | ||||
'causes an unrecoverable error.', | 'causes an unrecoverable error.', | ||||
'arc'), | 'arc'), | ||||
'default' => false, | 'default' => false, | ||||
'example' => 'false', | 'example' => 'false', | ||||
), | ), | ||||
'aliases' => array( | |||||
'type' => 'aliases', | |||||
'help' => pht( | |||||
'Configured command aliases. Use "arc alias" to define aliases.'), | |||||
), | |||||
); | ); | ||||
} | } | ||||
private function getOption($key) { | private function getOption($key) { | ||||
return idx($this->getOptions(), $key, array()); | return idx($this->getOptions(), $key, array()); | ||||
} | } | ||||
public function getAllKeys() { | public function getAllKeys() { | ||||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | switch ($type) { | ||||
pht( | pht( | ||||
"Type of setting '%s' must be string.", | "Type of setting '%s' must be string.", | ||||
$key)); | $key)); | ||||
} | } | ||||
$value = (string)$value; | $value = (string)$value; | ||||
break; | break; | ||||
case 'wild': | case 'wild': | ||||
break; | break; | ||||
case 'aliases': | |||||
throw new Exception( | |||||
pht( | |||||
'Use "arc alias" to configure aliases, not "arc set-config".')); | |||||
break; | |||||
} | } | ||||
return $value; | return $value; | ||||
} | } | ||||
public function willReadValue($key, $value) { | public function willReadValue($key, $value) { | ||||
$type = $this->getType($key); | $type = $this->getType($key); | ||||
switch ($type) { | switch ($type) { | ||||
Show All 17 Lines | switch ($type) { | ||||
if (!is_array($value)) { | if (!is_array($value)) { | ||||
throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
pht( | pht( | ||||
"Type of setting '%s' must be list.", | "Type of setting '%s' must be list.", | ||||
$key)); | $key)); | ||||
} | } | ||||
break; | break; | ||||
case 'wild': | case 'wild': | ||||
case 'aliases': | |||||
break; | break; | ||||
} | } | ||||
return $value; | return $value; | ||||
} | } | ||||
public function formatConfigValueForDisplay($key, $value) { | public function formatConfigValueForDisplay($key, $value) { | ||||
if ($value === false) { | if ($value === false) { | ||||
Show All 32 Lines |