NationalSecurityAgency/ghidra · error · IllegalArgumentException
Missing required parameter ({}) before specified option: {}
Error message
Missing required parameter ({}) before specified option: {} What it means
Thrown by checkRequiredParam when the slot that should hold a required positional argument instead contains a '--' option token. This means an option appeared before a required positional was supplied, so the parser cannot fill the positional slot.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimControlLaunchable.java:361
}
}
if (sawNoLocalAuth) { // Turn off authentication for local connections
authConfigPresent = true;
localAuthentication = AUTHENTICATION_NONE;
}
if (connectingUserName == null) {
connectingUserName = ClientUtil.getUserName();
}
}
private void checkRequiredParam(String[] params, int index, String name) {
if (params.length <= index) {
throw new IllegalArgumentException("Missing required parameter: " + name);
}
String p = params[index];
if (p.startsWith("--")) {
throw new IllegalArgumentException(
"Missing required parameter (" + name + ") before specified option: " + p);
}
}
private int parsePositiveIntegerOption(String option, String optionValue) {
try {
int value = Integer.valueOf(optionValue);
if (value < 0) {
throw new IllegalArgumentException("Negative value not permitted for " + option);
}
return value;
}
catch (NumberFormatException e) {
throw new IllegalArgumentException("Invalid integer value specified for " + option);
}
}
/**View on GitHub (pinned to d5f144c24d)
Solutions
- Move the required positional argument before the options.
- Keep the convention: positionals first, then --options.
- Use --help to confirm the expected positional order.
Example fix
// before bsim control configure --port 5432 myhost // after bsim control configure myhost --port 5432
Defensive patterns
Strategy: validation
Validate before calling
// Required positionals must precede any --option token.
for (int i = 0; i < requiredPositionalCount; i++) {
if (i < params.length && params[i].startsWith("--")) {
System.err.println("Required positional #" + (i + 1) + " missing before option " + params[i]);
return;
}
} Try / catch
try {
launchable.checkRequiredParam(params, index, name);
} catch (IllegalArgumentException e) {
if (e.getMessage().startsWith("Missing required parameter (")) {
System.err.println("Put required positional arguments before the options.");
}
throw e;
} Prevention
- Enforce positionals-first ordering in your wrapper scripts.
- Validate that no --option appears before the required positional slots are filled.
- Document the canonical argument order per subcommand.
When it happens
Trigger: Placing options before a required positional, e.g. `bsim control configure --port 5432 myhost` where configure expects the host first (line 361).
Common situations: Reordering args so options come first, or assuming options can precede positionals like in some other CLIs.
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/967912b8cb6f434f.
Report an issue: GitHub.