{"record":{"id":"0bf9517962789d86","repo":"opendataloader-project/opendataloader-pdf","slug":"option-hybrid-requires-a-value-supported-values","errorCode":null,"errorMessage":"Option --hybrid requires a value. Supported values: %s","messagePattern":"Option --hybrid requires a value\\. Supported values: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/cli/CLIOptions.java","lineNumber":654,"sourceCode":"            if (rawValue == null) {\n                continue;\n            }\n            String[] splitValues = rawValue.split(\",\");\n            for (String candidate : splitValues) {\n                String format = candidate.trim().toLowerCase(Locale.ROOT);\n                if (!format.isEmpty()) {\n                    values.add(format);\n                }\n            }\n        }\n        return values;\n    }\n\n    private static void applyHybridOptions(Config config, CommandLine commandLine) {\n        if (commandLine.hasOption(HYBRID_LONG_OPTION)) {\n            String hybridValue = commandLine.getOptionValue(HYBRID_LONG_OPTION);\n            if (hybridValue == null || hybridValue.trim().isEmpty()) {\n                throw new IllegalArgumentException(\n                        String.format(\"Option --hybrid requires a value. Supported values: %s\",\n                                Config.getHybridOptions(\", \")));\n            }\n            String hybrid = hybridValue.trim().toLowerCase(Locale.ROOT);\n            if (!Config.isValidHybrid(hybrid)) {\n                throw new IllegalArgumentException(\n                        String.format(\"Unsupported hybrid backend '%s'. Supported values: %s\",\n                                hybrid, Config.getHybridOptions(\", \")));\n            }\n            config.setHybrid(hybrid);\n        }\n        if (commandLine.hasOption(HYBRID_MODE_LONG_OPTION)) {\n            String modeValue = commandLine.getOptionValue(HYBRID_MODE_LONG_OPTION);\n            if (modeValue == null || modeValue.trim().isEmpty()) {\n                throw new IllegalArgumentException(\n                        String.format(\"Option --hybrid-mode requires a value. Supported values: %s\",\n                                Config.getHybridModeOptions(\", \")));\n            }","sourceCodeStart":636,"sourceCodeEnd":672,"githubUrl":"https://github.com/opendataloader-project/opendataloader-pdf/blob/a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8/java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/cli/CLIOptions.java#L636-L672","documentation":"Thrown while applying --hybrid when the flag is present but its value is missing, null, or blank. The handler checks getOptionValue for null/empty before lowercasing and validating via Config.isValidHybrid. Supported backends are off, docling, docling-fast (deprecated alias), hancom, hancom-ai; the message is generated dynamically from Config.getHybridOptions.","triggerScenarios":"Run `--hybrid` with no token, `--hybrid \"\"`, or `--hybrid --hybrid-url http://...` where the URL token is consumed or absent.","commonSituations":"Truncated flag in a script; equals form `--hybrid=` empty; a launcher that injects the backend name from an unset variable.","solutions":["Supply a backend: `--hybrid hancom-ai` or `--hybrid docling`.","Use `--hybrid=off` to explicitly disable.","Omit the flag (default is off)."],"exampleFix":"// before\nopendataloader-pdf doc.pdf --hybrid\n// after\nopendataloader-pdf doc.pdf --hybrid hancom-ai","handlingStrategy":"type-guard","validationCode":"String v = commandLine.getOptionValue(\"hybrid\");\nif (v != null && !v.trim().isEmpty() && !Config.isValidHybrid(v.trim().toLowerCase(Locale.ROOT))) {\n    throw new IllegalArgumentException(\"Bad --hybrid: \" + v);\n}","typeGuard":"boolean isAcceptableHybrid(String v) {\n    return v != null && !v.trim().isEmpty()\n        && Config.isValidHybrid(v.trim().toLowerCase(Locale.ROOT));\n}","tryCatchPattern":"try {\n    CLIOptions.applyAllTo(config, cmd);\n} catch (IllegalArgumentException e) {\n    System.err.println(\"Bad CLI args: \" + e.getMessage());\n    System.exit(2);\n}","preventionTips":["Use --hybrid=value form to surface missing values as syntax errors.","Default to off by omitting the flag.","Drive help text from Config.getHybridOptions so the list stays accurate."],"tags":["cli","hybrid","validation","argument-parsing"],"backgroundTag":null,"analyzedSha":"a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8","analyzedAt":"2026-08-14T05:22:03.953Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}