NationalSecurityAgency/ghidra · error · IllegalArgumentException

Unsupported command: {}

Error message

Unsupported command: {}

What it means

Thrown by readOptions() when the command (subcommand) name passed to the BSim control launchable has no entry in ALLOWED_OPTION_MAP. The tool only accepts a fixed set of registered subcommands, and this check runs before any option parsing, so an unrecognized command is rejected immediately.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimControlLaunchable.java:250

		readOptions(command, params, slot);

		return command;
	}

	/**
	 * Read in any optional parameters, strip them from the parameter stream
	 * @param command command name
	 * @param params is the original array of command line parameters
	 * @param discard number of params already consumed
	 */
	private void readOptions(String command, String[] params, int discard) {

		boolean sawNoLocalAuth = false;

		Set<String> allowedParams = ALLOWED_OPTION_MAP.get(command);
		if (allowedParams == null) {
			throw new IllegalArgumentException("Unsupported command: " + command);
		}

		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("--")) {

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Run the tool with --help (or inspect the usage) to list the supported subcommands.
  2. Compare your command spelling against the keys registered in ALLOWED_OPTION_MAP in BSimControlLaunchable.java.
  3. Make sure the subcommand is the first positional token, before any --options.
  4. Confirm you are on a Ghidra version where that subcommand still exists.

Example fix

// before
bsim control star
// after
bsim control start
Defensive patterns

Strategy: validation

Validate before calling

// Validate the subcommand against the known set before launching.
Set<String> known = Set.of("configure", "start", "stop", "status", "adduser", "upgrade", "list");
if (!known.contains(command)) {
    System.err.println("Unknown command: " + command + ". Valid: " + known);
    printUsage();
    return;
}
launchable.execute(args);

Try / catch

try {
    launchable.execute(args);
} catch (IllegalArgumentException e) {
    // message starts with "Unsupported command:"
    System.err.println(e.getMessage());
    printAvailableCommands();
}

Prevention

When it happens

Trigger: Invoking the launchable with a command string that is not a key in ALLOWED_OPTION_MAP (e.g. `bsim control star` or `bsim control <typo>`). The lookup `ALLOWED_OPTION_MAP.get(command)` returns null and the exception fires at line 250.

Common situations: Typo in the subcommand, using a command name renamed/removed in a newer Ghidra version, copy-pasting from outdated docs, or accidentally placing a global option where the subcommand token is expected.

Related errors


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