NationalSecurityAgency/ghidra · error · IllegalArgumentException
Missing option value: {}
Error message
Missing option value: {} What it means
Thrown when a value-taking option (a member of VALUE_OPTIONS) is the last token on the command line with no value following it. The parser attempts to consume the next param as the value but reaches the end of the array (line 293).
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimControlLaunchable.java:293
if (!option.startsWith("--")) {
throw new IllegalArgumentException("Unexpected argument: " + option);
}
if (!GLOBAL_OPTIONS.contains(option) && !allowedParams.contains(option)) {
throw new IllegalArgumentException("Unsupported option use: " + optionName);
}
if (!VALUE_OPTIONS.contains(option)) {
// option without value arg
if (value != null) {
throw new IllegalArgumentException(
"Unsupported option specification: " + optionName + "=");
}
}
else if (StringUtils.isBlank(value)) {
// consume next param as option value
if (++i == params.length) {
throw new IllegalArgumentException("Missing option value: " + optionName);
}
value = params[i];
}
switch (option) {
case PORT_OPTION:
port = parsePositiveIntegerOption(optionName, value);
break;
case USER_OPTION:
connectingUserName = value;
break;
case CERT_OPTION:
certParameter = value;
break;
case CAFILE_OPTION:
certAuthorityFile = new File(value);
break;
case AUTH_OPTION:View on GitHub (pinned to d5f144c24d)
Solutions
- Provide the value immediately after the option: `--port 5432`.
- Use the `--option=value` form to keep the pair together and shell-safe.
- Check shell escaping for quotes/backslashes that consumed the value.
Example fix
// before bsim control configure host --port // after bsim control configure host --port 5432
Defensive patterns
Strategy: validation
Validate before calling
// Ensure every value-option has a following value (or inline =value) before launch.
for (int i = 0; i < params.length; i++) {
String p = params[i];
String name = p.contains("=") ? p.substring(0, p.indexOf('=')) : p;
if (VALUE_OPTIONS.contains(name) && !p.contains("=") && i == params.length - 1) {
System.err.println(name + " requires a value but none follows.");
return;
}
} Try / catch
try {
launchable.readOptions(command, params, discard);
} catch (IllegalArgumentException e) {
if (e.getMessage().startsWith("Missing option value:")) {
System.err.println("Supply a value for " + e.getMessage());
}
throw e;
} Prevention
- Prefer the --option=value form in scripts so the pair cannot be split by shell quoting.
- Sanity-check that every value-option is followed by a value before invoking.
- Watch for shell quoting that silently consumes the trailing value.
When it happens
Trigger: Ending the command with a value-option and nothing after it, e.g. `bsim control configure host --port` with no port number.
Common situations: Truncated command lines, a value eaten by shell quoting/escaping, or copy-paste that cut off the trailing value.
Related errors
- Unknown command: {}
- Unsupported command: {}
- Unsupported option use: {}
- Unexpected argument: {}
- Unsupported option specification: {}=
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/1ee71e808dc98402.
Report an issue: GitHub.