Skip to content

Improve error message for usageHelp and versionHelp validation #350

@remkop

Description

@remkop

Current output when misconfigured:

Exception in thread "main" picocli.CommandLine$InitializationException: Non-boolean options (like -s) should not be marked as 'usageHelp=true'.
	at picocli.CommandLine$Model$CommandSpec.validate(CommandLine.java:2760)
	at picocli.CommandLine$Model$CommandReflection.extractCommandSpec(CommandLine.java:4026)
...

A more user-friendly error message could look like this:

Non-boolean options like [--serviceName, --connection, --rfafile, --username] should not be marked as 'usageHelp=true'. Usually a command only has one --help option that triggers display of the usage help message. Alternatively, consider using @Command(mixinStandardHelpOptions = true) on your command instead.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions