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())