Differential D21795 Diff 51951 src/applications/drydock/management/DrydockManagementLeaseWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/management/DrydockManagementLeaseWorkflow.php
Show All 35 Lines | public function execute(PhutilArgumentParser $args) { | ||||
if (!$resource_type) { | if (!$resource_type) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
'Specify a resource type with `%s`.', | 'Specify a resource type with `%s`.', | ||||
'--type')); | '--type')); | ||||
} | } | ||||
$until = $args->getArg('until'); | $until = $args->getArg('until'); | ||||
if (strlen($until)) { | if (phutil_nonempty_string($until)) { | ||||
$until = strtotime($until); | $until = strtotime($until); | ||||
if ($until <= 0) { | if ($until <= 0) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
'Unable to parse argument to "%s".', | 'Unable to parse argument to "%s".', | ||||
'--until')); | '--until')); | ||||
} | } | ||||
} | } | ||||
$attributes_file = $args->getArg('attributes'); | $attributes_file = $args->getArg('attributes'); | ||||
if (strlen($attributes_file)) { | if (phutil_nonempty_string($attributes_file)) { | ||||
if ($attributes_file == '-') { | if ($attributes_file == '-') { | ||||
echo tsprintf( | echo tsprintf( | ||||
"%s\n", | "%s\n", | ||||
'Reading JSON attributes from stdin...'); | 'Reading JSON attributes from stdin...'); | ||||
$data = file_get_contents('php://stdin'); | $data = file_get_contents('php://stdin'); | ||||
} else { | } else { | ||||
$data = Filesystem::readFile($attributes_file); | $data = Filesystem::readFile($attributes_file); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |