NationalSecurityAgency/ghidra · error · IllegalArgumentException
Unsupported option use: {}
Error message
Unsupported option use: {} What it means
Thrown when an argument starts with a single dash '-' but not '--', and that token is not a registered key in SHORTCUT_OPTION_MAP. The tool resolves single-dash shortcuts to their long form; an unmapped shortcut is rejected.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimControlLaunchable.java:271
for (int i = discard; i < params.length; ++i) {
String optionName = params[i];
String value = null;
if (optionName.startsWith("-")) {
// although not prefered, allow option value to be specified as --option=value
int ix = optionName.indexOf("=");
if (ix > 1) {
value = optionName.substring(ix + 1);
optionName = optionName.substring(0, ix);
}
}
String option = optionName;
if (optionName.startsWith("-") && !optionName.startsWith("--")) {
option = SHORTCUT_OPTION_MAP.get(optionName); // map option to -- long form
if (option == null) {
throw new IllegalArgumentException("Unsupported option use: " + optionName);
}
}
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 + "=");
}
}View on GitHub (pinned to d5f144c24d)
Solutions
- Switch to the canonical long form, e.g. `--port` instead of `-port`.
- Verify the shortcut actually exists by checking SHORTCUT_OPTION_MAP in source.
- Run --help to see the accepted options and their shortcuts.
Example fix
// before bsim control configure host -p 5432 // if -p is unmapped // after bsim control configure host --port 5432
Defensive patterns
Strategy: validation
Validate before calling
// Resolve single-dash shortcuts yourself before delegating, or reject unknown ones early.
String resolved = SHORTCUT_OPTION_MAP.containsKey(token) ? SHORTCUT_OPTION_MAP.get(token) : null;
if (token.startsWith("-") && !token.startsWith("--") && resolved == null) {
System.err.println("Unknown shortcut: " + token + ". Use a --long option.");
return;
} Try / catch
try {
launchable.readOptions(command, params, discard);
} catch (IllegalArgumentException e) {
if (e.getMessage().startsWith("Unsupported option use:")) {
suggestLongFormOptions();
}
throw e;
} Prevention
- Prefer the canonical --long form in scripts and docs to avoid shortcut ambiguity.
- Document the registered shortcuts next to each long option.
- Reject unknown single-dash tokens early with a helpful message.
When it happens
Trigger: Passing an unknown short flag such as `-x` or `-p` where `-p` is not a registered shortcut (line 271). Any single-dash token absent from SHORTCUT_OPTION_MAP triggers it.
Common situations: Using a single dash for what should be a long option (e.g. `-port` instead of `--port`), assuming a shortcut exists when it does not, or typos in shortcut flags.
Related errors
- Unknown command: {}
- Unsupported command: {}
- Unexpected argument: {}
- Unsupported option specification: {}=
- Missing option value: {}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/7c496c14af1511e4.
Report an issue: GitHub.