picocli icon indicating copy to clipboard operation
picocli copied to clipboard

Recursive subcommand could give better error

Open battery-staple opened this issue 8 months ago • 1 comments

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. :-)

battery-staple avatar May 30 '24 20:05 battery-staple