feat: add support for Cobra command groups#33
Closed
dnapier wants to merge 5 commits intocharmbracelet:mainfrom
Closed
feat: add support for Cobra command groups#33dnapier wants to merge 5 commits intocharmbracelet:mainfrom
dnapier wants to merge 5 commits intocharmbracelet:mainfrom
Conversation
- Add GroupedCommands struct to organize commands by group - Implement evalGroupedCmds function to process command groups - Update help rendering to display group headers - Maintain backward compatibility for ungrouped commands - Handle empty groups gracefully Resolves charmbracelet#32
Contributor
Author
|
Fixing linter errors. |
… into add-command-groups
caarlos0
added a commit
that referenced
this pull request
Jun 23, 2025
- supports grouped commands (alternative impl of #33) - fixes the help flag styles Co-authored-by: David Napier <dnapier@users.noreply.github.com>
Contributor
|
made an alternative implementation at #42 added you as co-author as well! thanks for the PR, btw <3 |
caarlos0
added a commit
that referenced
this pull request
Jun 23, 2025
* feat: support grouped commands and fix flag style - supports grouped commands (alternative impl of #33) - fixes the help flag styles Co-authored-by: David Napier <dnapier@users.noreply.github.com> * fix: sort * fix: keep original ordering * fix: grouping * fix: lint * fix: double check --------- Co-authored-by: David Napier <dnapier@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
• Adds support for organizing commands into groups using Cobra's command grouping functionality
• Allows developers to categorize related commands for better CLI organization and user experience
Test plan
Closes #32