{"record":{"id":"d95705b2ceac15f1","repo":"phacility/phabricator","slug":"use-the-s-flag-to-specify-one-or-more-messages-d95705","errorCode":null,"errorMessage":"Use the '%s' flag to specify one or more messages to show.","messagePattern":"Use the '(.+?)' flag to specify one or more messages to show\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php","lineNumber":28,"sourceCode":"      ->setExamples(\n        '**show-inbound** --id 1 --id 2')\n      ->setArguments(\n        array(\n          array(\n            'name'    => 'id',\n            'param'   => 'id',\n            'help'    => pht('Show details about inbound mail with given ID.'),\n            'repeat'  => true,\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $console = PhutilConsole::getConsole();\n\n    $ids = $args->getArg('id');\n    if (!$ids) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          \"Use the '%s' flag to specify one or more messages to show.\",\n          '--id'));\n    }\n\n    $messages = id(new PhabricatorMetaMTAReceivedMail())->loadAllWhere(\n      'id IN (%Ld)',\n      $ids);\n\n    if ($ids) {\n      $ids = array_fuse($ids);\n      $missing = array_diff_key($ids, $messages);\n      if ($missing) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Some specified messages do not exist: %s',\n            implode(', ', array_keys($missing))));\n      }","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php#L10-L46","documentation":"`bin/mail show-inbound` requires at least one message ID via the repeatable `--id` flag; with no IDs it has nothing to load from PhabricatorMetaMTAReceivedMail and throws PhutilArgumentUsageException immediately. Inbound message IDs are the numeric IDs of received-mail records.","triggerScenarios":"Running show-inbound with no arguments; passing IDs via an unrecognized flag name; a script whose ID list expanded empty.","commonSituations":"Exploratory runs to 'see what the command does'; forgetting that this tool is per-ID rather than a listing tool.","solutions":["Pass one or more IDs: `bin/mail show-inbound --id 123 --id 456`.","Find IDs in the web UI under the received-mail (MetaMTAReceivedMail) list or from `bin/mail show-inbound` on a known recent message.","In scripts, assert the ID list is non-empty before invoking."],"exampleFix":"// before\n$ bin/mail show-inbound\n// Exception: Use the '--id' flag to specify one or more messages to show.\n\n// after\n$ bin/mail show-inbound --id 123","handlingStrategy":"validation","validationCode":"if (empty($ids)) {\n  fwrite(STDERR, \"show-inbound requires one or more --id values.\\n\");\n  exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Source inbound IDs from the received-mail list in the web UI.","Assert non-empty ID lists in scripts.","Remember the flag is repeatable: --id 1 --id 2."],"tags":["php","phabricator","cli","argument-validation","mail"],"backgroundTag":"missing-cli-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}