{"record":{"id":"20a1f1e22d06f8cf","repo":"apache/cassandra","slug":"abbreviated-subcommands-are-not-allowed","errorCode":null,"errorMessage":"Abbreviated subcommands are not allowed.","messagePattern":"Abbreviated subcommands are not allowed\\.","errorType":"console","errorClass":"CommandLine.ParameterException","httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/tools/nodetool/Help.java","lineNumber":87,"sourceCode":"    public void run()\n    {\n        CommandLine parent = self == null ? null : self.getParent();\n        if (parent == null)\n            return;\n\n        CommandLine.Help.ColorScheme colors = colorScheme == null ?\n                                              CommandLine.Help.defaultColorScheme(CommandLine.Help.Ansi.AUTO) :\n                                              colorScheme;\n\n        if (commands == null)\n        {\n            // If the parent command is the top-level command, print help for the top-level command.\n            printTopCommandUsage(parent, colors, out);\n            return;\n        }\n\n        if (parent.isAbbreviatedSubcommandsAllowed())\n            throw new CommandLine.ParameterException(parent, \"Abbreviated subcommands are not allowed.\");\n\n        // Print help for the last command in the list of commands.\n        CommandLine subcommand = parent;\n        for (String command : commands)\n        {\n            subcommand = subcommand.getSubcommands().get(command);\n            if (subcommand == null)\n                throw new CommandLine.ParameterException(parent, \"Unknown subcommand '\" + command + \"'.\", null, command);\n        }\n\n        subcommand.usage(out, colors);\n    }\n\n    public static void printTopCommandUsage(CommandLine command, CommandLine.Help.ColorScheme colors, PrintWriter writer)\n    {\n        if (command == null)\n            return;\n","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/Help.java#L69-L105","documentation":"picocli's Help command (wrapped by Cassandra's nodetool Help) refuses to print help when the user navigated to it via an abbreviated subcommand path, if the parent command disallows abbreviation. It throws CommandLine.ParameterException('Abbreviated subcommands are not allowed.') because resolving commands through abbreviations would make the displayed help ambiguous.","triggerScenarios":"Invoking `nodetool <abbreviated-cmd> help <args>` (or `help` with shortened command names) where the parent command was reached by prefix matching and `isAbbreviatedSubcommandsAllowed()` is false.","commonSituations":"Users relying on shell-style prefix abbreviation like `nodetool comp help`, assuming nodetool supports it; scripts that shorten subcommand names.","solutions":["Spell out the full subcommand path, e.g. `nodetool compactionhints help` instead of an abbreviation","Use `nodetool help <full-command>` from the top level","If you own the command, enable abbreviated subcommands on the parent via picocli's subcommandsRepeatable/abbreviation support"],"exampleFix":"// before\nnodetool stat help\n// after\nnodetool status help","handlingStrategy":"validation","validationCode":"# avoid abbreviated subcommand paths before invoking help\ncase \"$CMD\" in nodetool*help*) echo \"use full subcommand names\";; esac","typeGuard":null,"tryCatchPattern":"// picocli ParameterException from help navigation\ntry { cmd.execute(args); } catch (CommandLine.ParameterException e) { System.err.println(e.getMessage()); cmd.usage(System.err); }","preventionTips":["Never rely on prefix abbreviation of nodetool subcommands","Use `nodetool help` (top-level) to discover full command names"],"tags":["cli","picocli","help","abbreviation"],"backgroundTag":"invalid-cli-argument","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}