From 7425407c126bbcee265982916068c75bdefa9870 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 8 Sep 2015 08:49:33 -0700 Subject: [PATCH] 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 --- resources/celerity/map.php | 6 ++-- ...PhabricatorConfigManagementSetWorkflow.php | 32 ++++++++++++------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index a478e285db..fd885f0f34 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -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', diff --git a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php index 1da30408ee..97586a77dd 100644 --- a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php +++ b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php @@ -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