{"record":{"id":"e222d9ad5f3c04d6","repo":"NationalSecurityAgency/ghidra","slug":"missing-required-parameter","errorCode":null,"errorMessage":"Missing required parameter: {}","messagePattern":"Missing required parameter: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimControlLaunchable.java","lineNumber":357,"sourceCode":"\t\t\t\t\tforceShutdown = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new AssertionError(\"Missing option handling: \" + option);\n\t\t\t}\n\t\t}\n\n\t\tif (sawNoLocalAuth) {\t// Turn off authentication for local connections\n\t\t\tauthConfigPresent = true;\n\t\t\tlocalAuthentication = AUTHENTICATION_NONE;\n\t\t}\n\t\tif (connectingUserName == null) {\n\t\t\tconnectingUserName = ClientUtil.getUserName();\n\t\t}\n\t}\n\n\tprivate void checkRequiredParam(String[] params, int index, String name) {\n\t\tif (params.length <= index) {\n\t\t\tthrow new IllegalArgumentException(\"Missing required parameter: \" + name);\n\t\t}\n\t\tString p = params[index];\n\t\tif (p.startsWith(\"--\")) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\"Missing required parameter (\" + name + \") before specified option: \" + p);\n\t\t}\n\t}\n\n\tprivate int parsePositiveIntegerOption(String option, String optionValue) {\n\t\ttry {\n\t\t\tint value = Integer.valueOf(optionValue);\n\t\t\tif (value < 0) {\n\t\t\t\tthrow new IllegalArgumentException(\"Negative value not permitted for \" + option);\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\t\tcatch (NumberFormatException e) {\n\t\t\tthrow new IllegalArgumentException(\"Invalid integer value specified for \" + option);","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimControlLaunchable.java#L339-L375","documentation":"Thrown by checkRequiredParam when the params array is shorter than the required positional index. Each subcommand mandates a minimum number of positional arguments (e.g. a host/repository path), and this fires before the option loop when a slot is absent.","triggerScenarios":"Calling a subcommand with fewer positional arguments than required, so `params.length <= index` at line 357.","commonSituations":"Forgetting a required positional (e.g. omitting the host), assuming it is optional, or a script dropping an argument.","solutions":["Supply the missing positional argument the message names.","Check the subcommand's usage via --help for the required positionals.","Verify your script/alias passes the full argument list."],"exampleFix":"// before\nbsim control configure --port 5432\n// after\nbsim control configure myhost --port 5432","handlingStrategy":"validation","validationCode":"// Ensure enough positional arguments exist before launching.\nint required = requiredPositionalsFor(command);\nif (positionalArgs.size() < required) {\n    System.err.println(\"Command \" + command + \" requires \" + required + \" positional argument(s).\");\n    printUsage(command);\n    return;\n}","typeGuard":null,"tryCatchPattern":"try {\n    launchable.checkRequiredParam(params, index, name);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Missing required parameter:\")) {\n        printUsage(command);\n    }\n    throw e;\n}","preventionTips":["Track each subcommand's required positional count and validate before dispatch.","Print usage whenever a required positional is missing.","In scripts, assert the argument count before invoking."],"tags":["cli","argument-validation","bsim"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}