NationalSecurityAgency/ghidra · warning · IllegalArgumentException

Unsupported option use: {}

Error message

Unsupported option use: {}

What it means

Thrown when a single-dash shortcut option (e.g., -x) is not found in SHORTCUT_OPTION_MAP. Only ten shortcuts are mapped: -a (--arch), -b (--bsim), -c (--config), -d (--description), -l (--limit), -m (--md5), -n (--name), -o (--owner), -s (--sortcol), -u (--user). Any other single-dash token is rejected.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java:318

		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("--")) {
				if (sawOptions) {
					throw new IllegalArgumentException("Unexpected argument: " + option);
				}
				subParams.add(params[i]);
				continue;
			}

			sawOptions = true;
			if (!GLOBAL_OPTIONS.contains(option) && !allowedParams.contains(option)) {
				throw new IllegalArgumentException("Unsupported option use: " + optionName);
			}
			if (!VALUE_OPTIONS.contains(option)) {
				// consume option without value arg as a boolean option
				if (value != null) {

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Use the full --long-form option name instead of the shortcut (e.g., --force instead of -f).
  2. Check the SHORTCUT_OPTION_MAP (lines 120-129) for the complete list of valid single-dash shortcuts.
  3. Do not combine single-dash options (e.g., -ab); use separate --arch --bsim.

Example fix

// before
bsim dropdatabase h2://localhost/db -f
// error: Unsupported option use: -f

// after
bsim dropdatabase h2://localhost/db --force
Defensive patterns

Strategy: validation

Validate before calling

Set<String> validShortcuts = Set.of("-a","-b","-c","-d","-l","-m","-n","-o","-s","-u");
for (String arg : args) {
    if (arg.startsWith("-") && !arg.startsWith("--") && !validShortcuts.contains(arg)) {
        throw new IllegalArgumentException("Unknown shortcut: " + arg + ". Use the --long form.");
    }
}

Prevention

When it happens

Trigger: Using an unmapped single-dash shortcut on the command line, such as -f, -p, -r, or -v. The parser only recognizes the ten predefined shortcuts.

Common situations: Assuming a shortcut exists for an option that only has a long form (e.g., trying -f for --force, -p for --printselfsig); using GNU-style combined short options like -ab which the parser does not support.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/ffc805f27c24cd7a. Report an issue: GitHub.