{"record":{"id":"b2253e78f3a8b978","repo":"opendataloader-project/opendataloader-pdf","slug":"option-table-method-requires-a-value-supported","errorCode":null,"errorMessage":"Option --table-method requires a value. Supported values: %s","messagePattern":"Option --table-method 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":505,"sourceCode":"                config.setImageResolution(imageResolution);\n            } catch (NumberFormatException e) {\n                throw new IllegalArgumentException(\n                    \"Option --image-resolution requires valid double value.\", e);\n            }\n        }\n    }\n\n    private static void applyPagesOption(Config config, CommandLine commandLine) {\n        if (commandLine.hasOption(PAGES_LONG_OPTION)) {\n            config.setPages(commandLine.getOptionValue(PAGES_LONG_OPTION));\n        }\n    }\n\n    private static void applyTableMethodOption(Config config, CommandLine commandLine) {\n        if (commandLine.hasOption(TABLE_METHOD_LONG_OPTION)) {\n            String methodValue = commandLine.getOptionValue(TABLE_METHOD_LONG_OPTION);\n            if (methodValue == null || methodValue.trim().isEmpty()) {\n                throw new IllegalArgumentException(\n                        String.format(\"Option --table-method requires a value. Supported values: %s\",\n                                Config.getTableMethodOptions(\", \")));\n            }\n            String method = methodValue.trim().toLowerCase(Locale.ROOT);\n            if (!Config.isValidTableMethod(method)) {\n                throw new IllegalArgumentException(\n                        String.format(\"Unsupported table method '%s'. Supported values: %s\",\n                                method, Config.getTableMethodOptions(\", \")));\n            }\n            config.setTableMethod(method);\n        }\n    }\n\n    private static void applyContentSafetyOption(Config config, CommandLine commandLine) {\n        if (!commandLine.hasOption(CONTENT_SAFETY_OFF_LONG_OPTION)) {\n            return;\n        }\n","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/opendataloader-project/opendataloader-pdf/blob/a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8/java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/cli/CLIOptions.java#L487-L523","documentation":"Thrown while applying --table-method when the flag is present but its value is missing, null, or blank. The handler reads getOptionValue and rejects null/empty before normalizing and validating against the table-method domain. Accepted values are default and cluster; the list is built dynamically via Config.getTableMethodOptions so the message always reflects the current set.","triggerScenarios":"Run `--table-method` with no following token, `--table-method \"\"`, or `--table-method --pages 1` where the next flag token is consumed or absent.","commonSituations":"Truncated command in a script; equals form `--table-method=` with nothing after the equals; YAML/JSON-to-CLI generator emits a key with a null value.","solutions":["Provide `default` or `cluster`.","Use `--table-method=cluster`.","Omit the flag to keep the default (default)."],"exampleFix":"// before\nopendataloader-pdf doc.pdf --table-method\n// after\nopendataloader-pdf doc.pdf --table-method cluster","handlingStrategy":"type-guard","validationCode":"String v = commandLine.getOptionValue(\"table-method\");\nif (v != null && !v.trim().isEmpty() && !Config.isValidTableMethod(v.trim().toLowerCase(Locale.ROOT))) {\n    throw new IllegalArgumentException(\"Bad --table-method: \" + v);\n}","typeGuard":"boolean isAcceptableTableMethod(String v) {\n    return v != null && !v.trim().isEmpty()\n        && Config.isValidTableMethod(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 --table-method=value form to make a missing value obvious.","Default to omitting the flag (default method) unless cluster is needed.","Surface Config.getTableMethodOptions in your help text."],"tags":["cli","table-method","validation","argument-parsing"],"backgroundTag":null,"analyzedSha":"a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8","analyzedAt":"2026-08-14T05:22:03.953Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}