{"record":{"id":"e8ea4ce2270ddde2","repo":"t8y2/dbx","slug":"unsupported-option","errorCode":null,"errorMessage":"Unsupported option: ","messagePattern":"Unsupported option: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"plugins/jdbc/src/main/java/app/dbx/jdbc/maven/DbxMavenResolver.java","lineNumber":154,"sourceCode":"        private String coordinate;\n        private String scope = JavaScopes.RUNTIME;\n        private Path localRepository = Path.of(System.getProperty(\"user.home\"), \".dbx\", \"maven\");\n        private final List<String> repositories = new ArrayList<>();\n\n        private static ResolverOptions parse(String[] args) {\n            ResolverOptions options = new ResolverOptions();\n            for (int index = 0; index < args.length; index++) {\n                String arg = args[index];\n                switch (arg) {\n                    case \"resolve\" -> {\n                    }\n                    case \"--coordinate\", \"-c\" -> options.coordinate = value(args, ++index, arg);\n                    case \"--scope\" -> options.scope = value(args, ++index, arg).toLowerCase(Locale.ROOT);\n                    case \"--repo\", \"--repository\" -> options.repositories.add(value(args, ++index, arg));\n                    case \"--local-repo\" -> options.localRepository = Path.of(value(args, ++index, arg));\n                    default -> {\n                        if (arg.startsWith(\"-\")) {\n                            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\");","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/plugins/jdbc/src/main/java/app/dbx/jdbc/maven/DbxMavenResolver.java#L136-L172","documentation":"The CLI argument parser (parse) throws IllegalArgumentException when it encounters an argument starting with '-' that it does not recognize as one of the supported flags (--coordinate/-c, --scope, --repo/--repository, --local-repo). Unknown flags are rejected instead of being ignored.","triggerScenarios":"Running the resolver with a misspelled or unsupported flag such as --coordinates, -r, or --verbose.","commonSituations":"Typo in flag name; copying a flag from a different tool; a newer/older version of the tool that does not support the flag; shell scripts passing extra flags.","solutions":["Use a supported flag: --coordinate/-c, --scope, --repo/--repository, --local-repo","Check the spelling/case of the flag (e.g. --coordinate not --coordinates)","Run with --help or inspect the parse method to see the supported option list"],"exampleFix":"// before\njava ... DbxMavenResolver --coordinates com.example:foo:1.0\n// after\njava ... DbxMavenResolver --coordinate com.example:foo:1.0","handlingStrategy":"validation","validationCode":"Set<String> SUPPORTED = Set.of(\"--coordinate\",\"-c\",\"--scope\",\"--repo\",\"--repository\",\"--local-repo\");\nfor (String a : args) {\n    if (a.startsWith(\"-\") && !SUPPORTED.contains(a) && !a.contains(\"=\")) {\n        throw new IllegalArgumentException(\"unknown flag: \" + a);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    Options o = Options.parse(args);\n} catch (IllegalArgumentException e) {\n    System.err.println(e.getMessage() + \"\\nUsage: --coordinate/-c, --scope, --repo, --local-repo\");\n    System.exit(2);\n}","preventionTips":["Only use documented flags: --coordinate/-c, --scope, --repo/--repository, --local-repo","Run --help first when unsure","Pin tool version in CI so flags match"],"tags":["cli","argument-parsing","unsupported-option"],"backgroundTag":"invalid-cli-flag","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"}