Page MenuHomePhabricator

D11925.id28728.diff
No OneTemporary

D11925.id28728.diff

diff --git a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php
--- a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php
+++ b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php
@@ -87,10 +87,34 @@
default:
$value = json_decode($value, true);
if (!is_array($value)) {
- throw new PhutilArgumentUsageException(pht(
- "Config key '%s' is of type '%s'. Specify it in JSON.",
- $key,
- $type));
+ switch ($type) {
+ case 'set':
+ $message = pht(
+ "Config key '%s' is of type '%s'. Specify it in JSON. ".
+ "For example:\n\n".
+ ' ./bin/config set \'{"value1": true, "value2": true}\''.
+ "\n",
+ $key,
+ $type);
+ break;
+ default:
+ if (preg_match('/^list</', $type)) {
+ $message = pht(
+ "Config key '%s' is of type '%s'. Specify it in JSON. ".
+ "For example:\n\n".
+ ' ./bin/config set \'["a", "b", "c"]\''.
+ "\n",
+ $key,
+ $type);
+ } else {
+ $message = pht(
+ 'Config key "%s" is of type "%s". Specify it in JSON.',
+ $key,
+ $type);
+ }
+ break;
+ }
+ throw new PhutilArgumentUsageException($message);
}
break;
}

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 28, 5:07 PM (21 h, 34 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6796142
Default Alt Text
D11925.id28728.diff (1 KB)

Event Timeline