{"record":{"id":"9b2525eac0181207","repo":"opendataloader-project/opendataloader-pdf","slug":"option-image-output-requires-a-value-supported","errorCode":null,"errorMessage":"Option --image-output requires a value. Supported values: %s","messagePattern":"Option --image-output 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":452,"sourceCode":"        }\n        if (requested < 1) {\n            throw new IllegalArgumentException(\n                    String.format(\"Option --threads requires an integer >= 1, got %d\", requested));\n        }\n        config.setThreads(requested);\n        int applied = config.getThreads();\n        if (applied < requested) {\n            System.err.println(String.format(\n                    \"Warning: --threads=%d exceeds available CPU cores; capped to %d.\",\n                    requested, applied));\n        }\n    }\n\n    private static void applyImageOptions(Config config, CommandLine commandLine) {\n        if (commandLine.hasOption(IMAGE_OUTPUT_LONG_OPTION)) {\n            String outputValue = commandLine.getOptionValue(IMAGE_OUTPUT_LONG_OPTION);\n            if (outputValue == null || outputValue.trim().isEmpty()) {\n                throw new IllegalArgumentException(\n                        String.format(\"Option --image-output requires a value. Supported values: %s\",\n                                Config.getImageOutputOptions(\", \")));\n            }\n            String output = outputValue.trim().toLowerCase(Locale.ROOT);\n            if (!Config.isValidImageOutput(output)) {\n                throw new IllegalArgumentException(\n                        String.format(\"Unsupported image output mode '%s'. Supported values: %s\",\n                                output, Config.getImageOutputOptions(\", \")));\n            }\n            config.setImageOutput(output);\n        }\n        if (commandLine.hasOption(IMAGE_FORMAT_LONG_OPTION)) {\n            String formatValue = commandLine.getOptionValue(IMAGE_FORMAT_LONG_OPTION);\n            if (formatValue == null || formatValue.trim().isEmpty()) {\n                throw new IllegalArgumentException(\n                        \"Option --image-format requires a value. Supported values: png, jpeg\");\n            }\n            String format = formatValue.trim().toLowerCase(Locale.ROOT);","sourceCodeStart":434,"sourceCodeEnd":470,"githubUrl":"https://github.com/opendataloader-project/opendataloader-pdf/blob/a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8/java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/cli/CLIOptions.java#L434-L470","documentation":"applyImageOptions detects that --image-output was supplied but its value is null or whitespace-only (after trim), and throws. This fires before any validity check on the mode itself, so an empty value never reaches the unsupported-mode branch (error [19]).","triggerScenarios":"CLI --image-output with no argument, --image-output \"\" or --image-output \"   \".","commonSituations":"Option flag passed but the value was consumed by a quoting/shell mistake; value sourced from an unset env var that expands to empty; argument parser misconfiguration.","solutions":["Supply a non-empty value: off, embedded, or external.","Check shell quoting and that the env var backing the value is set before invoking the CLI."],"exampleFix":"# before: --image-output \"\"   # or --image-output with no arg\n# after:  --image-output embedded","handlingStrategy":"validation","validationCode":"String v = rawImageOutput;\nif (v == null || v.trim().isEmpty()) {\n    throw new IllegalArgumentException(\n        \"--image-output requires a value. Valid: \" + Config.getImageOutputOptions(\", \"));\n}","typeGuard":"static boolean hasImageOutputValue(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try { /* build config with --image-output */ }\ncatch (IllegalArgumentException e) { /* prompt for off|embedded|external */ }","preventionTips":["Check shell quoting and that env vars backing CLI values are non-empty.","Treat a blank value as a missing value upstream."],"tags":["configuration","validation","cli","image-output"],"backgroundTag":null,"analyzedSha":"a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8","analyzedAt":"2026-08-14T05:22:03.953Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}