Skip to content

Recursive subcommand could give better error #2293

Description

@battery-staple

This is a very minor issue. I accidentally created a command that has itself as a subcommand, like this:

import picocli.CommandLine.Command;

@Command(name = "bad", subcommands = BadCommand.class)
public class BadCommand {

}

While this is of course incorrect, it gives a fairly opaque error:
error: FATAL ERROR: java.util.regex.PatternSyntaxException: Stack overflow during pattern compilation near index 9.

It might save someone else in the future a bit of trouble if this gave a more descriptive error. :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions