Skip to content

feat: support grouped commands and fix flag style#42

Merged
caarlos0 merged 6 commits intomainfrom
sub-cmds
Jun 23, 2025
Merged

feat: support grouped commands and fix flag style#42
caarlos0 merged 6 commits intomainfrom
sub-cmds

Conversation

@caarlos0
Copy link
Copy Markdown
Member

@caarlos0 caarlos0 commented Jun 23, 2025

CleanShot 2025-06-23 at 10 21 05@2x

closes #32
closes #33

- supports grouped commands (alternative impl of #33)
- fixes the help flag styles

Co-authored-by: David Napier <dnapier@users.noreply.github.com>
@caarlos0 caarlos0 requested review from Copilot and meowgorithm June 23, 2025 12:05
@caarlos0 caarlos0 self-assigned this Jun 23, 2025
@caarlos0 caarlos0 added the enhancement New feature or request label Jun 23, 2025

This comment was marked as outdated.

@caarlos0 caarlos0 requested a review from Copilot June 23, 2025 12:54

This comment was marked as outdated.

@caarlos0 caarlos0 requested a review from Copilot June 23, 2025 13:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for grouped commands in the CLI and improves the formatting of help flag styles. Key changes include:

  • Adjusted indentation and spacing in various help golden files.
  • Addition of group handling (evalGroups and renderGroup functions) in help.go.
  • Updated tests and examples to reflect the new grouped command functionality.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
testdata/TestSetup/*/help.golden Updated flag spacing and indentation
testdata/TestSetup/with_command_groups/* Added new grouped command sections
help.go Introduced grouped commands rendering and refactored evalCmds/evalGroups
fang_test.go Added tests for command groups
example/main.go Updated example to include command groups

@caarlos0 caarlos0 merged commit e582283 into main Jun 23, 2025
18 checks passed
@caarlos0 caarlos0 deleted the sub-cmds branch June 23, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Command Groups Not Displayed Properly in Fang

2 participants