{"record":{"id":"87c354f3ccddd1a1","repo":"phacility/phabricator","slug":"specify-the-name-of-an-object-to-show-policy-infor","errorCode":null,"errorMessage":"Specify the name of an object to show policy information for.","messagePattern":"Specify the name of an object to show policy information for\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php","lineNumber":26,"sourceCode":"      ->setName('show')\n      ->setSynopsis(pht('Show policy information about an object.'))\n      ->setExamples('**show** D123')\n      ->setArguments(\n        array(\n          array(\n            'name'      => 'objects',\n            'wildcard'  => true,\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $console = PhutilConsole::getConsole();\n    $viewer = $this->getViewer();\n\n    $obj_names = $args->getArg('objects');\n    if (!$obj_names) {\n      throw new PhutilArgumentUsageException(\n        pht('Specify the name of an object to show policy information for.'));\n    } else if (count($obj_names) > 1) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify the name of exactly one object to show policy information '.\n          'for.'));\n    }\n\n    $object = id(new PhabricatorObjectQuery())\n      ->setViewer($viewer)\n      ->withNames($obj_names)\n      ->executeOne();\n\n    if (!$object) {\n      $name = head($obj_names);\n      throw new PhutilArgumentUsageException(\n        pht(\n          \"No such object '%s'!\",","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php#L8-L44","documentation":"bin/policy show prints the policies attached to exactly one object. The workflow reads the `objects` wildcard argument and throws this PhutilArgumentUsageException when the list is empty, before any query runs.","triggerScenarios":"Running ./bin/policy show with no arguments at all.","commonSituations":"Exploring the CLI, forgetting the argument inside cron or deployment scripts, and copy-pasting a truncated command line from docs.","solutions":["Pass one object name or monogram: ./bin/policy show T123","If scripting, check the arguments before invoking and emit your own usage message."],"exampleFix":"# before\n./bin/policy show\n# after\n./bin/policy show T123","handlingStrategy":"validation","validationCode":"#!/bin/sh\n[ \"$#\" -ge 1 ] || { echo 'usage: bin/policy show <object>' >&2; exit 64; }\nexec ./bin/policy show \"$@\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wrap CLI calls in scripts that verify arguments first.","Run ./bin/policy help show when adding a new invocation to a script."],"tags":["phabricator","cli","usage","policy"],"backgroundTag":"cli-missing-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}