Summary
When @OptionGroup has only a shortName set and no explicit name, aesh derives a long option name from the Java field name. This creates a spurious long name that is confusing and may not even work.
Example
@OptionGroup(shortName = 'D', description = "set a system property", defaultValue = "true")
Map<String, String> properties;
Help renders as:
-D, --properties=<key=value> set a system property
The --properties name comes from the field name and was never intended as a user-facing option name. In picocli this was just -D=<String=String> with no long name.
Expected behavior
When @OptionGroup has a shortName but no explicit name (or name = ""), only the short name should be shown:
-D=<key=value> set a system property
The long name derived from the field name should not be shown in help or accepted on the command line unless explicitly set via the name attribute.
Context
Found in jbang (jbangdev/jbang#2453) where -D is used for system properties. The derived --properties name confused reviewers.
Summary
When
@OptionGrouphas only ashortNameset and no explicitname, aesh derives a long option name from the Java field name. This creates a spurious long name that is confusing and may not even work.Example
Help renders as:
The
--propertiesname comes from the field name and was never intended as a user-facing option name. In picocli this was just-D=<String=String>with no long name.Expected behavior
When
@OptionGrouphas ashortNamebut no explicitname(orname = ""), only the short name should be shown:The long name derived from the field name should not be shown in help or accepted on the command line unless explicitly set via the
nameattribute.Context
Found in jbang (jbangdev/jbang#2453) where
-Dis used for system properties. The derived--propertiesname confused reviewers.