apache/cassandra · warning · CommandLine.ParameterException
Abbreviated subcommands are not allowed.
Error message
Abbreviated subcommands are not allowed.
What it means
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.
Source
Thrown at src/java/org/apache/cassandra/tools/nodetool/Help.java:87
public void run()
{
CommandLine parent = self == null ? null : self.getParent();
if (parent == null)
return;
CommandLine.Help.ColorScheme colors = colorScheme == null ?
CommandLine.Help.defaultColorScheme(CommandLine.Help.Ansi.AUTO) :
colorScheme;
if (commands == null)
{
// If the parent command is the top-level command, print help for the top-level command.
printTopCommandUsage(parent, colors, out);
return;
}
if (parent.isAbbreviatedSubcommandsAllowed())
throw new CommandLine.ParameterException(parent, "Abbreviated subcommands are not allowed.");
// Print help for the last command in the list of commands.
CommandLine subcommand = parent;
for (String command : commands)
{
subcommand = subcommand.getSubcommands().get(command);
if (subcommand == null)
throw new CommandLine.ParameterException(parent, "Unknown subcommand '" + command + "'.", null, command);
}
subcommand.usage(out, colors);
}
public static void printTopCommandUsage(CommandLine command, CommandLine.Help.ColorScheme colors, PrintWriter writer)
{
if (command == null)
return;
View on GitHub (pinned to 88fd0f6a0e)
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
Example fix
// before nodetool stat help // after nodetool status help
Defensive patterns
Strategy: validation
Validate before calling
# avoid abbreviated subcommand paths before invoking help case "$CMD" in nodetool*help*) echo "use full subcommand names";; esac
Try / catch
// picocli ParameterException from help navigation
try { cmd.execute(args); } catch (CommandLine.ParameterException e) { System.err.println(e.getMessage()); cmd.usage(System.err); } Prevention
- Never rely on prefix abbreviation of nodetool subcommands
- Use `nodetool help` (top-level) to discover full command names
When it happens
Trigger: 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.
Common situations: Users relying on shell-style prefix abbreviation like `nodetool comp help`, assuming nodetool supports it; scripts that shorten subcommand names.
Understand the failure class
Background: "Unknown argument", "Invalid value", and "must be one of": invalid CLI argument errors explained — this error's family across 35 libraries.
Related errors
- Unknown subcommand '
- Failed to initialize command line hierarchy
- No JmxConnect command found in the top-level hierarchy
- Invalid command/option provided to help
- Invalid command or option provided to command help
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/20a1f1e22d06f8cf.
Report an issue: GitHub.