NationalSecurityAgency/ghidra · warning · IllegalArgumentException

Missing option value: {}

Error message

Missing option value: {}

What it means

Thrown when a value-requiring option (in VALUE_OPTIONS) is the last token on the command line with no following argument to serve as its value. Options like --md5, --name, --limit, --bsim, --config, --user, etc. all expect a value argument after them.

Source

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

			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) {
					throw new IllegalArgumentException(
						"Unsupported option specification: " + optionName + "=");
				}
				booleanOptions.add(option);
			}
			else if (!StringUtils.isBlank(value)) {
				optionValueMap.put(option, value);
			}
			else {
				// consume next param as option value
				if (++i == params.length) {
					throw new IllegalArgumentException("Missing option value: " + optionName);
				}
				optionValueMap.put(option, params[i]);
			}
		}
		return subParams;
	}

	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("--") || p.contains("=")) {
			throw new IllegalArgumentException(
				"Missing required parameter (" + name + ") before specified option: " + p);
		}
	}

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Provide a value argument immediately after the option: '--md5 <hex-value>'.
  2. Check that shell quoting or variable expansion did not consume the value token.
  3. If using the = form, ensure the value is included: '--md5=abc123'.

Example fix

// before
bsim listexes h2://localhost/db --md5
// error: Missing option value: --md5

// after
bsim listexes h2://localhost/db --md5 d41d8cd98f00b204e9800998ecf8427e
Defensive patterns

Strategy: validation

Validate before calling

Set<String> valueOptions = Set.of("--user","--cert","--bsim","--name","--owner","--description","--override","--config","--md5","--maxfunc","--arch","--compiler","--limit","--sortcol");
for (int i = 0; i < args.length; i++) {
    if (valueOptions.contains(args[i]) && !args[i].contains("=")) {
        if (i == args.length - 1) {
            throw new IllegalArgumentException("Option " + args[i] + " requires a value but none was provided");
        }
    }
}

Prevention

When it happens

Trigger: A command line ending with a value option that has no following argument, e.g., 'bsim listexes h2://localhost/db --md5' with nothing after --md5. The parser reaches the end of params while looking for the value.

Common situations: Truncated command line from a copy-paste error; shell quoting that consumed the value; forgetting the value argument entirely.

Related errors


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