{"record":{"id":"e55eb8b751472b6f","repo":"t8y2/dbx","slug":"requires-a-value","errorCode":null,"errorMessage":" requires a value","messagePattern":" requires a value","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"plugins/jdbc/src/main/java/app/dbx/jdbc/maven/DbxMavenResolver.java","lineNumber":172,"sourceCode":"                            throw new IllegalArgumentException(\"Unsupported option: \" + arg);\n                        }\n                        if (options.coordinate == null) {\n                            options.coordinate = arg;\n                        } else {\n                            throw new IllegalArgumentException(\"Unexpected argument: \" + arg);\n                        }\n                    }\n                }\n            }\n            if (options.repositories.isEmpty()) {\n                options.repositories.add(DEFAULT_REPOSITORY);\n            }\n            return options;\n        }\n\n        private static String value(String[] args, int index, String option) {\n            if (index >= args.length || args[index].isBlank()) {\n                throw new IllegalArgumentException(option + \" requires a value\");\n            }\n            return args[index];\n        }\n    }\n\n    public record ResolveResult(\n        String coordinate,\n        String scope,\n        List<String> repositories,\n        List<ResolvedArtifact> artifacts\n    ) {\n    }\n\n    public record ResolvedArtifact(\n        String groupId,\n        String artifactId,\n        String version,\n        String classifier,","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/plugins/jdbc/src/main/java/app/dbx/jdbc/maven/DbxMavenResolver.java#L154-L190","documentation":"The private value() helper throws IllegalArgumentException when an option flag (e.g. --coordinate, --scope, --repo, --local-repo) is present but has no following non-blank argument. The message is '<option> requires a value'.","triggerScenarios":"Ending the command line with a flag and no value, e.g. '--repo' as the last token, or passing '--scope ' with a blank value.","commonSituations":"Truncated command in CI config; shell variable expanding to empty (e.g. --scope $SCOPE with SCOPE unset); newline-separated arguments mis-split by a script.","solutions":["Supply the value directly after the flag: --scope runtime, --repo <url>","Ensure the shell variable holding the value is set and non-empty","Check CI pipeline logs for the command being truncated"],"exampleFix":"// before\nmvn-ish resolve --scope $SCOPE com.example:foo:1.0   # SCOPE unset\n// after\nSCOPE=runtime DbxMavenResolver --scope \"$SCOPE\" com.example:foo:1.0","handlingStrategy":"validation","validationCode":"for (int i = 0; i < args.length; i++) {\n    if (List.of(\"--coordinate\",\"--scope\",\"--repo\",\"--local-repo\").contains(args[i])\n            && (i + 1 >= args.length || args[i+1].isBlank())) {\n        throw new IllegalArgumentException(args[i] + \" requires a value\");\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    Options o = Options.parse(args);\n} catch (IllegalArgumentException e) {\n    System.err.println(e.getMessage());\n    System.exit(2);\n}","preventionTips":["Never end a command line with a bare flag","Guard shell variables: ${SCOPE:?SCOPE must be set}","Check CI logs for truncated commands"],"tags":["cli","argument-parsing","missing-value"],"backgroundTag":"missing-required-argument","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}