picocli
picocli copied to clipboard
Recursive subcommand could give better error
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. :-)