'argv', ); } public function run() { $argv = $this->getArgument('argv'); if (count($argv) != 2) { throw new ArcanistUsageException("Specify a key and a value."); } $config = self::readGlobalArcConfig(); $key = $argv[0]; $val = $argv[1]; $old = null; if (array_key_exists($key, $config)) { $old = $config[$key]; } if (!strlen($val)) { unset($config[$key]); self::writeGlobalArcConfig($config); if ($old === null) { echo "Deleted key '{$key}'.\n"; } else { echo "Deleted key '{$key}' (was '{$old}').\n"; } } else { $config[$key] = $val; self::writeGlobalArcConfig($config); if ($old === null) { echo "Set key '{$key}' = '{$val}'.\n"; } else { echo "Set key '{$key}' = '{$val}' (was '{$old}').\n"; } } return 0; } }