enhancement(cli): group commands by topic

This commit is contained in:
Florian Schade
2025-12-15 16:40:27 +01:00
parent 879de39129
commit 9904e5b932
9 changed files with 36 additions and 22 deletions
+8
View File
@@ -24,6 +24,14 @@ func Execute() error {
for _, commandFactory := range register.Commands {
command := commandFactory(cfg)
if command.GroupID != "" && !app.ContainsGroup(command.GroupID) {
app.AddGroup(&cobra.Group{
ID: command.GroupID,
Title: command.GroupID,
})
}
app.AddCommand(command)
}
app.SetArgs(os.Args[1:])