Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15380029
D19751.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
D19751.diff
View Options
diff --git a/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php b/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php
--- a/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php
+++ b/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php
@@ -20,9 +20,11 @@
'help' => pht('Set lease expiration time.'),
),
array(
- 'name' => 'attributes',
- 'param' => 'name=value,...',
- 'help' => pht('Resource specification.'),
+ 'name' => 'attributes',
+ 'param' => 'file',
+ 'help' => pht(
+ 'JSON file with lease attributes. Use "-" to read attributes '.
+ 'from stdin.'),
),
));
}
@@ -49,11 +51,20 @@
}
}
- $attributes = $args->getArg('attributes');
- if ($attributes) {
- $options = new PhutilSimpleOptions();
- $options->setCaseSensitive(true);
- $attributes = $options->parse($attributes);
+ $attributes_file = $args->getArg('attributes');
+ if (strlen($attributes_file)) {
+ if ($attributes_file == '-') {
+ echo tsprintf(
+ "%s\n",
+ 'Reading JSON attributes from stdin...');
+ $data = file_get_contents('php://stdin');
+ } else {
+ $data = Filesystem::readFile($attributes_file);
+ }
+
+ $attributes = phutil_json_decode($data);
+ } else {
+ $attributes = array();
}
$lease = id(new DrydockLease())
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 15, 1:00 AM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7362472
Default Alt Text
D19751.diff (1 KB)
Attached To
Mode
D19751: In "bin/drydock lease", take a JSON "--attributes" so we can accept complex values
Attached
Detach File
Event Timeline
Log In to Comment