{"record":{"id":"d2653ae4e68d7592","repo":"phacility/phabricator","slug":"specify-an-atomizer-class-with-s","errorCode":null,"errorMessage":"Specify an atomizer class with %s.","messagePattern":"Specify an atomizer class with (.+?)\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/diviner/workflow/DivinerAtomizeWorkflow.php","lineNumber":39,"sourceCode":"          array(\n            'name' => 'files',\n            'wildcard' => true,\n          ),\n          array(\n            'name' => 'ugly',\n            'help' => pht('Produce ugly (but faster) output.'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $this->readBookConfiguration($args->getArg('book'));\n\n    $console = PhutilConsole::getConsole();\n\n    $atomizer_class = $args->getArg('atomizer');\n    if (!$atomizer_class) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify an atomizer class with %s.',\n          '--atomizer'));\n    }\n\n    $symbols = id(new PhutilSymbolLoader())\n      ->setName($atomizer_class)\n      ->setConcreteOnly(true)\n      ->setAncestorClass('DivinerAtomizer')\n      ->selectAndLoadSymbols();\n    if (!$symbols) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          \"Atomizer class '%s' must be a concrete subclass of %s.\",\n          $atomizer_class,\n          'DivinerAtomizer'));\n    }\n","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diviner/workflow/DivinerAtomizeWorkflow.php#L21-L57","documentation":"Diviner's `atomize` workflow turns source files into documentation atoms and needs an atomizer class to do the conversion. This PhutilArgumentUsageException is thrown at the top of execute() when the `--atomizer` flag is omitted, because the flag is declared without a default (DivinerAtomizeWorkflow.php:12-15). It is the CLI's standard usage-error signal: the process exits with a usage message instead of a stack trace.","triggerScenarios":"Running `diviner atomize` (or invoking DivinerAtomizeWorkflow::execute) with no `--atomizer` flag, i.e. $args->getArg('atomizer') is falsy. Any invocation that only passes `--book` and file wildcards hits it.","commonSituations":"Running Diviner manually for the first time and copying a partial command from docs; scripts that assume DivinerPHPAtomizer is the implicit default (it is not, unlike `--publisher` on `generate`); CI jobs assembled from a template that dropped the flag.","solutions":["Re-run with the flag: `diviner atomize --book docs/book.book --atomizer DivinerPHPAtomizer <files...>`","Use a shipped concrete atomizer class such as DivinerPHPAtomizer unless you wrote your own","If automating, check the flag is non-empty in your wrapper script before invoking `diviner atomize`"],"exampleFix":"# before\ndiviner atomize --book docs/book.book src/\n# after\ndiviner atomize --book docs/book.book --atomizer DivinerPHPAtomizer src/","handlingStrategy":"validation","validationCode":"$atomizer = $args->getArg('atomizer');\nif (!strlen((string)$atomizer)) {\n  // Do not invoke the workflow without an atomizer class.\n  $args->printHelpAndExit();\n}","typeGuard":null,"tryCatchPattern":"try {\n  $workflow->execute($args);\n} catch (PhutilArgumentUsageException $ex) {\n  // Usage errors are operator errors: show the message, exit non-zero.\n  fwrite(STDERR, $ex->getMessage().\"\\n\");\n  exit(1);\n}","preventionTips":["Always pair `diviner atomize` with `--atomizer DivinerPHPAtomizer` (or your concrete subclass)","In wrapper scripts, fail fast on empty required flags before invoking diviner","Treat PhutilArgumentUsageException as a usage message, never as a defect to debug"],"tags":["diviner","cli","usage-error","missing-argument","phabricator"],"backgroundTag":"missing-cli-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}