{"record":{"id":"6b45cae2897410ea","repo":"NationalSecurityAgency/ghidra","slug":"invalid-generateupdates-parameter-use","errorCode":null,"errorMessage":"Invalid generateupdates parameter use!","messagePattern":"Invalid generateupdates parameter use!","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java","lineNumber":628,"sourceCode":"\n\t\ttry (BulkSignatures bsim = getBulkSignatures()) {\n\t\t\tif (commitOption) {\n\t\t\t\t// Generate and commit signatures to BSim database\n\t\t\t\tbsim.signatureRepo(ghidraURL, xmlDirectory, overwriteOption, monitor);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Generate sig XML files only\n\t\t\t\tbsim.generateSignaturesFromServer(ghidraURL, xmlDirectory, overwriteOption,\n\t\t\t\t\tconfigOption, monitor);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void doGenerateUpdates(List<String> params, TaskMonitor monitor)\n\t\t\tthrows Exception, CancelledException {\n\t\t// concurrent --bsim and --config option use already checked\n\t\tif (params.size() > 1) {\n\t\t\tthrow new IllegalArgumentException(\"Invalid generateupdates parameter use!\");\n\t\t}\n\t\tboolean commitOption = booleanOptions.contains(COMMIT_OPTION);\n\t\tboolean overwriteOption = booleanOptions.contains(OVERWRITE_OPTION);\n\t\tString configOption = optionValueMap.get(CONFIG_OPTION);\n\n\t\tString xmlDirectory = null;\n\t\tif (params.size() == 1) {\n\t\t\txmlDirectory = params.get(0);\n\t\t\tif (configOption != null && commitOption) {\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Invalid option use with \" + CONFIG_OPTION + \" option: \" + COMMIT_OPTION);\n\t\t\t}\n\n\t\t}\n\t\telse {\n\t\t\tif (overwriteOption) {\n\t\t\t\tthrow new IllegalArgumentException(\"Invalid option use: \" + OVERWRITE_OPTION);\n\t\t\t}","sourceCodeStart":610,"sourceCodeEnd":646,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java#L610-L646","documentation":"Thrown by doGenerateUpdates() when more than one positional argument is supplied. Like generatesigs, generateupdates accepts at most one positional: an optional XML output directory. This is the update-file-generation variant of error 963, with identical structure.","triggerScenarios":"Running 'generateupdates <ghidraURL> dir1 dir2' or passing a template as a bare positional instead of via --config. params.size() > 1 at line 627.","commonSituations":"Confusing generatesigs and generateupdates syntax; passing the config template positionally; shell splitting a quoted path.","solutions":["Ensure at most one positional XML directory follows the ghidraURL.","Use --config <template> rather than a bare positional for the template.","Review the valid generateupdates forms at lines 1037-1039."],"exampleFix":"// before\nbsim generateupdates ghidra://myhost/Repo /tmp/out medium_64\n// after\nbsim generateupdates ghidra://myhost/Repo /tmp/out --config medium_64","handlingStrategy":"validation","validationCode":"// For generateupdates: positional count must be 0 or 1\nif (\"generateupdates\".equals(command) && positionalParams.size() > 1) {\n    throw new IllegalArgumentException(\"generateupdates accepts at most one XML directory positional\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Share the positional-count validation between generatesigs and generateupdates.","Pass templates via --config, never as a bare positional."],"tags":["cli","argument-validation","bsim","generateupdates"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}