{"record":{"id":"ffc805f27c24cd7a","repo":"NationalSecurityAgency/ghidra","slug":"unsupported-option-use-ffc805","errorCode":null,"errorMessage":"Unsupported option use: {}","messagePattern":"Unsupported option use: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java","lineNumber":318,"sourceCode":"\t\tfor (int i = discard; i < params.length; ++i) {\n\t\t\tString optionName = params[i];\n\t\t\tString value = null;\n\n\t\t\tif (optionName.startsWith(\"-\")) {\n\t\t\t\t// although not prefered, allow option value to be specified as --option=value\n\t\t\t\tint ix = optionName.indexOf(\"=\");\n\t\t\t\tif (ix > 1) {\n\t\t\t\t\tvalue = optionName.substring(ix + 1);\n\t\t\t\t\toptionName = optionName.substring(0, ix);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tString option = optionName;\n\n\t\t\tif (optionName.startsWith(\"-\") && !optionName.startsWith(\"--\")) {\n\t\t\t\toption = SHORTCUT_OPTION_MAP.get(optionName); // map option to -- long form\n\t\t\t\tif (option == null) {\n\t\t\t\t\tthrow new IllegalArgumentException(\"Unsupported option use: \" + optionName);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!option.startsWith(\"--\")) {\n\t\t\t\tif (sawOptions) {\n\t\t\t\t\tthrow new IllegalArgumentException(\"Unexpected argument: \" + option);\n\t\t\t\t}\n\t\t\t\tsubParams.add(params[i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tsawOptions = true;\n\t\t\tif (!GLOBAL_OPTIONS.contains(option) && !allowedParams.contains(option)) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unsupported option use: \" + optionName);\n\t\t\t}\n\t\t\tif (!VALUE_OPTIONS.contains(option)) {\n\t\t\t\t// consume option without value arg as a boolean option\n\t\t\t\tif (value != null) {","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java#L300-L336","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use the full --long-form option name instead of the shortcut (e.g., --force instead of -f).","Check the SHORTCUT_OPTION_MAP (lines 120-129) for the complete list of valid single-dash shortcuts.","Do not combine single-dash options (e.g., -ab); use separate --arch --bsim."],"exampleFix":"// before\nbsim dropdatabase h2://localhost/db -f\n// error: Unsupported option use: -f\n\n// after\nbsim dropdatabase h2://localhost/db --force","handlingStrategy":"validation","validationCode":"Set<String> validShortcuts = Set.of(\"-a\",\"-b\",\"-c\",\"-d\",\"-l\",\"-m\",\"-n\",\"-o\",\"-s\",\"-u\");\nfor (String arg : args) {\n    if (arg.startsWith(\"-\") && !arg.startsWith(\"--\") && !validShortcuts.contains(arg)) {\n        throw new IllegalArgumentException(\"Unknown shortcut: \" + arg + \". Use the --long form.\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer --long-form options over single-dash shortcuts to avoid ambiguity.","Refer to the SHORTCUT_OPTION_MAP for the complete list of valid shortcuts.","Never combine single-dash options (e.g., -ab); BSim does not support bundling."],"tags":["bsim","ghidra","command-line","argument-parsing","cli-usage"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}