NationalSecurityAgency/ghidra · error · IllegalArgumentException

Unknown option: {}

Error message

Unknown option: {}

What it means

Thrown by doInstallTags() when more than one positional argument is supplied to addfunctiontag. The command accepts exactly one positional (the tag name). The error message says 'Unknown option' rather than 'Unexpected parameter' (as used in doCreateDatabase/doInstallCategory), which is a minor wording inconsistency but semantically the same condition: too many positionals.

Source

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

		}
	}

	/**
	 * Inserts a new function tag into the BSim database.
	 * 
	 * This variant of the tag install method is intended for command-line
	 * users. 
	 * 
	 * @param params the command-line params
	 * @throws IOException if there's an error establishing the database connection
	 * @throws LSHException if there's an error issuing the query
	 */
	private void doInstallTags(List<String> params) throws IOException, LSHException {
		if (params.size() < 1) {
			throw new IllegalArgumentException("Missing name of new function tag");
		}
		if (params.size() > 1) {
			throw new IllegalArgumentException("Unknown option: " + params.get(1));
		}

		String functionTag = params.get(0);

		try (BulkSignatures bsim = getBulkSignatures()) {
			bsim.installTags(functionTag);
		}
	}

	/**
	 * Exports exe signature to local folder in XML format.
	 * 
	 * @param params the command-line params
	 * @throws IOException if there's an error establishing the database connection
	 * @throws LSHException if there's an error issuing the query
	 */
	private void doDumpSigs(List<String> params) throws IOException, LSHException {
		if (params.size() < 1) {

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Pass exactly one tag name per invocation.
  2. Call addfunctiontag multiple times to add several tags.

Example fix

// before
bsim addfunctiontag postgresql://myhost/BsimDB tag1 tag2
// after
bsim addfunctiontag postgresql://myhost/BsimDB tag1
bsim addfunctiontag postgresql://myhost/BsimDB tag2
Defensive patterns

Strategy: validation

Validate before calling

// addfunctiontag takes exactly one positional
if ("addfunctiontag".equals(command) && positionalParams.size() != 1) {
    throw new IllegalArgumentException("addfunctiontag takes exactly one tag name; call it multiple times for several tags");
}

Prevention

When it happens

Trigger: Running 'bsim addfunctiontag <bsimURL> <tag_name> <extra>'. params.size() > 1 at line 970.

Common situations: Supplying multiple tags in one invocation (the command takes one); an option without '--' treated as positional; shell splitting.

Related errors


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