{"record":{"id":"6373430bdd565451","repo":"NationalSecurityAgency/ghidra","slug":"missing-option-value-637343","errorCode":null,"errorMessage":"Missing option value: {}","messagePattern":"Missing option value: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java","lineNumber":348,"sourceCode":"\t\t\tsawOptions = true;\n\t\t\tif (!GLOBAL_OPTIONS.contains(option) && !allowedParams.contains(option)) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unsupported option use: \" + optionName);\n\t\t\t}\n\t\t\tif (!VALUE_OPTIONS.contains(option)) {\n\t\t\t\t// consume option without value arg as a boolean option\n\t\t\t\tif (value != null) {\n\t\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\"Unsupported option specification: \" + optionName + \"=\");\n\t\t\t\t}\n\t\t\t\tbooleanOptions.add(option);\n\t\t\t}\n\t\t\telse if (!StringUtils.isBlank(value)) {\n\t\t\t\toptionValueMap.put(option, value);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// consume next param as option value\n\t\t\t\tif (++i == params.length) {\n\t\t\t\t\tthrow new IllegalArgumentException(\"Missing option value: \" + optionName);\n\t\t\t\t}\n\t\t\t\toptionValueMap.put(option, params[i]);\n\t\t\t}\n\t\t}\n\t\treturn subParams;\n\t}\n\n\tprivate void checkRequiredParam(String[] params, int index, String name) {\n\t\tif (params.length <= index) {\n\t\t\tthrow new IllegalArgumentException(\"Missing required parameter: \" + name);\n\t\t}\n\t\tString p = params[index];\n\t\tif (p.startsWith(\"--\") || p.contains(\"=\")) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\"Missing required parameter (\" + name + \") before specified option: \" + p);\n\t\t}\n\t}\n","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java#L330-L366","documentation":"Thrown when a value-requiring option (in VALUE_OPTIONS) is the last token on the command line with no following argument to serve as its value. Options like --md5, --name, --limit, --bsim, --config, --user, etc. all expect a value argument after them.","triggerScenarios":"A command line ending with a value option that has no following argument, e.g., 'bsim listexes h2://localhost/db --md5' with nothing after --md5. The parser reaches the end of params while looking for the value.","commonSituations":"Truncated command line from a copy-paste error; shell quoting that consumed the value; forgetting the value argument entirely.","solutions":["Provide a value argument immediately after the option: '--md5 <hex-value>'.","Check that shell quoting or variable expansion did not consume the value token.","If using the = form, ensure the value is included: '--md5=abc123'."],"exampleFix":"// before\nbsim listexes h2://localhost/db --md5\n// error: Missing option value: --md5\n\n// after\nbsim listexes h2://localhost/db --md5 d41d8cd98f00b204e9800998ecf8427e","handlingStrategy":"validation","validationCode":"Set<String> valueOptions = Set.of(\"--user\",\"--cert\",\"--bsim\",\"--name\",\"--owner\",\"--description\",\"--override\",\"--config\",\"--md5\",\"--maxfunc\",\"--arch\",\"--compiler\",\"--limit\",\"--sortcol\");\nfor (int i = 0; i < args.length; i++) {\n    if (valueOptions.contains(args[i]) && !args[i].contains(\"=\")) {\n        if (i == args.length - 1) {\n            throw new IllegalArgumentException(\"Option \" + args[i] + \" requires a value but none was provided\");\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always provide a value argument immediately after value-requiring options.","Use the = syntax (--option=value) to guarantee the value is attached.","Check VALUE_OPTIONS to know which options require values."],"tags":["bsim","ghidra","command-line","argument-parsing","cli-usage"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}