Summary
When generateHelp = true is set on @CommandDefinition or @GroupCommandDefinition, aesh auto-generates a --help option with optionalValue = true. This causes --help to appear in documentation and help output as if it accepts a value parameter:
-h, --help=_<help>_ Display help (use --help=all for all options)
This is misleading -- --help is universally understood as a boolean flag in CLI tools. Users do not expect --help to take a value.
Current behavior
The auto-generated help option is created in ProcessedCommand.doGenerateHelp() with:
hasValue = true (to support --help=all)
optionalValue = true (so bare --help works without a value)
This means:
- Help output shows
--help=_<help>_ instead of just --help
- Documentation generators render it as a value-taking option
- Shell completion suggests
--help= with a trailing =
Expected behavior
--help should be rendered as a simple boolean flag in help output and documentation:
-h, --help Display help (use --help=all for all options)
The --help=all variant can still work internally, but the option presentation should not suggest that a value is expected or typical.
Workaround
Documentation generators can special-case --help to suppress the value display, but this shouldn't be necessary.
Context
Found during the jbang picocli-to-aesh migration (jbangdev/jbang#2453). The picocli version rendered --help as a simple flag.
Summary
When
generateHelp = trueis set on@CommandDefinitionor@GroupCommandDefinition, aesh auto-generates a--helpoption withoptionalValue = true. This causes--helpto appear in documentation and help output as if it accepts a value parameter:This is misleading --
--helpis universally understood as a boolean flag in CLI tools. Users do not expect--helpto take a value.Current behavior
The auto-generated help option is created in
ProcessedCommand.doGenerateHelp()with:hasValue = true(to support--help=all)optionalValue = true(so bare--helpworks without a value)This means:
--help=_<help>_instead of just--help--help=with a trailing=Expected behavior
--helpshould be rendered as a simple boolean flag in help output and documentation:The
--help=allvariant can still work internally, but the option presentation should not suggest that a value is expected or typical.Workaround
Documentation generators can special-case
--helpto suppress the value display, but this shouldn't be necessary.Context
Found during the jbang picocli-to-aesh migration (jbangdev/jbang#2453). The picocli version rendered
--helpas a simple flag.