{"record":{"id":"d0046d4e10bec2f0","repo":"apache/cassandra","slug":"unknown-subcommand","errorCode":null,"errorMessage":"Unknown subcommand '","messagePattern":"Unknown subcommand '","errorType":"console","errorClass":"CommandLine.ParameterException","httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/tools/nodetool/Help.java","lineNumber":95,"sourceCode":"                                              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\n        StringBuilder sb = new StringBuilder();\n        CommandLine.Help help = command.getHelpFactory().create(command.getCommandSpec(), colors);\n        if (!(help instanceof CassandraCliHelpLayout))\n        {\n            command.usage(writer, colors);\n            return;\n        }\n","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/Help.java#L77-L113","documentation":"The Help command walks the list of command names given on the command line, resolving each against the parent command's subcommands. When a name does not resolve, it throws CommandLine.ParameterException(\"Unknown subcommand '<name>'.\"). The message is truncated in this index because the name is concatenated at runtime.","triggerScenarios":"`nodetool help foo` where 'foo' is not a registered subcommand; typos; calling help for a command that exists only in newer Cassandra versions.","commonSituations":"Typo in command name; using a command name from a different Cassandra version's nodetool; assuming tool names from other projects (e.g. `nodetool repair` variants that don't exist).","solutions":["Run `nodetool help` alone to list valid subcommands and check spelling","Verify the subcommand exists in your Cassandra version's nodetool","If scripting, validate command names against `nodetool help` output before invoking"],"exampleFix":"// before\nnodetool help compactoinstats   # typo\n// after\nnodetool help compactionstats","handlingStrategy":"validation","validationCode":"# check the subcommand exists before asking for its help\nnodetool help | grep -qw \"$SUBCMD\" && nodetool help \"$SUBCMD\"","typeGuard":null,"tryCatchPattern":"try { cmd.execute(args); } catch (CommandLine.ParameterException e) { System.err.println(e.getMessage()); cmd.usage(System.err); }","preventionTips":["Validate command names against `nodetool help` output in scripts","Check command availability for your Cassandra version","Watch for typos; command names are case-sensitive"],"tags":["cli","picocli","help","typo"],"backgroundTag":"command-not-found","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"}