{"record":{"id":"45c8b002ff1dfe4f","repo":"phacility/phabricator","slug":"specify-one-or-more-objects-to-destroy","errorCode":null,"errorMessage":"Specify one or more objects to destroy.","messagePattern":"Specify one or more objects to destroy\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php","lineNumber":29,"sourceCode":"      ->setArguments(\n        array(\n          array(\n            'name' => 'force',\n            'help' => pht('Destroy objects without prompting.'),\n          ),\n          array(\n            'name' => 'objects',\n            'wildcard' => true,\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $console = PhutilConsole::getConsole();\n\n    $object_names = $args->getArg('objects');\n    if (!$object_names) {\n      throw new PhutilArgumentUsageException(\n        pht('Specify one or more objects to destroy.'));\n    }\n\n    $object_query = id(new PhabricatorObjectQuery())\n      ->setViewer($this->getViewer())\n      ->withNames($object_names);\n\n    $object_query->execute();\n\n    $named_objects = $object_query->getNamedResults();\n    foreach ($object_names as $object_name) {\n      if (empty($named_objects[$object_name])) {\n        throw new PhutilArgumentUsageException(\n          pht('No such object \"%s\" exists!', $object_name));\n      }\n    }\n\n    foreach ($named_objects as $object_name => $object) {","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php#L11-L47","documentation":"PhabricatorSystemRemoveDestroyWorkflow (bin/remove destroy) takes one or more object names as wildcard positional arguments. execute() throws PhutilArgumentUsageException when the objects argument list is empty; no query or destruction is attempted.","triggerScenarios":"Running ./bin/remove destroy with no positional object names (monograms or PHIDs), typically because a shell variable holding the names expanded to nothing.","commonSituations":"Scripts where the names array is empty due to an upstream filter; invoking the command expecting an interactive object picker that does not exist.","solutions":["Pass at least one object name: ./bin/remove destroy T123","If scripting, guard so the command only runs when the names list is non-empty","Check the command's argument spec (phutil executable workflow) when automating"],"exampleFix":"# before\n./bin/remove destroy\n\n# after\n./bin/remove destroy T123","handlingStrategy":"validation","validationCode":"# bash wrapper: refuse to invoke with no names\nif [ -z \"$1\" ]; then\n  echo \"no object names supplied\" >&2\n  exit 1\nfi\n./bin/remove destroy \"$@\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the argument list is non-empty before invoking the workflow","Treat PhutilArgumentUsageException text as the command's own validation output"],"tags":["cli","usage","destroy","bin"],"backgroundTag":"missing-cli-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}