Skip to content

feat(base-commandline): commands, categories, multi-prefix options, and positional argument builder#45

Merged
deer merged 1 commit intomainfrom
more_commandline
Apr 18, 2026
Merged

feat(base-commandline): commands, categories, multi-prefix options, and positional argument builder#45
deer merged 1 commit intomainfrom
more_commandline

Conversation

@deer
Copy link
Copy Markdown
Collaborator

@deer deer commented Apr 18, 2026

Extends CommandLineParser and the Command fluent builder with four additions that close the remaining gap between base-commandline and a full flat-CLI framework:

  • Declarative commands and categoriesregisterCommand / registerCategory (and Command.command / Command.category) add Commands: and Categories: sections to help output, sorted alphabetically. Section headings are overridable via
    setCommandsSectionName / setCategoriesSectionName (e.g. spin can render Tasks: / Aliases:).
  • Multi-prefix options without annotationsCommandLineParser.add(List<String>, Class, methodName, description, paramTypes...) and the matching Command.option(List<String>, ...) overload register an option under multiple prefixes with an
    explicit description, no @CommandLine.Prefix or @CommandLine.Description required.
  • Command.positionalArgument(Consumer<String>) — fluent wrapper for setPositionalArgumentConsumer, completing the builder API.
  • Help rendering fix — prefixes are now tracked in methodPrefixes at registration time, so explicitly-registered options appear correctly in help (previously only annotation-driven options rendered their prefixes).

@deer deer merged commit 291881f into main Apr 18, 2026
3 checks passed
@deer deer deleted the more_commandline branch April 18, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant