Skip to content

Conversation

@DCodeProg
Copy link
Contributor

This pull request introduces support for registering sub-commands in the command declaration builder, improving the structure and extensibility of command definitions. It adds a new SubCommandDeclaration interface and integrates it into the command builder workflow, allowing for more modular and type-safe sub-command registration.

Sub-command support and integration:

  • Added a new SubCommandDeclaration interface in sub_command_declaration.dart, requiring implementers to provide a build method that returns a SubCommandBuilder. This also enforces that sub-commands are Listenable.
  • Updated CommandDeclarationBuilder to include a registerSubCommand method, which registers sub-commands by accepting a factory function that must return a SubCommandDeclaration instance. This method validates the type and adds the built sub-command to the builder.
  • Imported the new sub_command_declaration.dart in both command_declaration_builder.dart and the public API file api.dart to make the interface available for use and export. [1] [2]

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