Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14110343
D11925.id28728.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11925.id28728.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11925: Improve error messages when specifying bad set or list to bin/config
Attached
Detach File
Event Timeline
Log In to Comment