1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Improve bin/config set errors for complex values

Summary:
  - Fix missing space before "For example:".
  - Fix instruction to run `bin/config set value` instead of `bin/config set key value`.
  - Minor cleanup.

Test Plan: Tried to set `files.image-mime-types`, `load-libraries`.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D14080
This commit is contained in:
epriestley 2015-09-08 08:49:33 -07:00
parent 6915011067
commit 7425407c12
2 changed files with 24 additions and 14 deletions

View file

@ -7,7 +7,7 @@
*/
return array(
'names' => array(
'core.pkg.css' => 'e9f745e2',
'core.pkg.css' => '3fcfaed8',
'core.pkg.js' => '47dc9ebb',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '2de124c9',
@ -104,7 +104,7 @@ return array(
'rsrc/css/application/tokens/tokens.css' => '3d0f239e',
'rsrc/css/application/uiexample/example.css' => '528b19de',
'rsrc/css/core/core.css' => 'a76cefc9',
'rsrc/css/core/remarkup.css' => 'ef286a6e',
'rsrc/css/core/remarkup.css' => '1c4ac273',
'rsrc/css/core/syntax.css' => '9fd11da8',
'rsrc/css/core/z-index.css' => '57ddcaa2',
'rsrc/css/diviner/diviner-shared.css' => '5a337049',
@ -737,7 +737,7 @@ return array(
'phabricator-object-selector-css' => '85ee8ce6',
'phabricator-phtize' => 'd254d646',
'phabricator-prefab' => '6920d200',
'phabricator-remarkup-css' => 'ef286a6e',
'phabricator-remarkup-css' => '1c4ac273',
'phabricator-search-results-css' => '7dea472c',
'phabricator-shaped-request' => '7cbe244b',
'phabricator-side-menu-view-css' => 'bec2458e',

View file

@ -96,25 +96,35 @@ final class PhabricatorConfigManagementSetWorkflow
if (!is_array($value)) {
switch ($type) {
case 'set':
$command = csprintf(
'./bin/config set %R %s',
$key,
'{"value1": true, "value2": true}');
$message = sprintf(
"%s%s\n\n %s\n",
pht(
"Config key '%s' is of type '%s'. Specify it in JSON.",
$key,
$type),
pht('For example:'),
'./bin/config set \'{"value1": true, "value2": true}\'');
"%s\n\n %s\n",
pht(
'Config key "%s" is of type "%s". Specify it in JSON. '.
'For example:',
$key,
$type),
$command);
break;
default:
if (preg_match('/^list</', $type)) {
$command = csprintf(
'./bin/config set %R %s',
$key,
'["a", "b", "c"]');
$message = sprintf(
"%s%s\n\n %s\n",
"%s\n\n %s\n",
pht(
"Config key '%s' is of type '%s'. Specify it in JSON.",
'Config key "%s" is of type "%s". Specify it in JSON. '.
'For example:',
$key,
$type),
pht('For example:'),
'./bin/config set \'["a", "b", "c"]\'');
$command);
} else {
$message = pht(
'Config key "%s" is of type "%s". Specify it in JSON.',