use new rootCmd name var

This commit is contained in:
Robin Olsen
2026-02-05 13:25:34 +01:00
parent 6caf654af9
commit 12748ede00
2 changed files with 7 additions and 6 deletions

View File

@@ -3,12 +3,12 @@ package main
import (
"context"
"github.com/LazyBachelor/LazyPM/internal/service"
"github.com/LazyBachelor/LazyPM/pkg/cli"
)
func main() {
config := service.Config{
config := cli.CLIConfig{
RootCmd: "pm",
IssuePrefix: "pm",
BeadsDBPath: "./.pm/db.db",
StatisticsStoragePath: "./.pm/stats.json",

View File

@@ -9,20 +9,21 @@ import (
var svc *service.Services
var rootCmd = &cobra.Command{
Use: "pm",
Short: "Project Management CLI",
Long: `Project Management CLI for managing issues and tasks.`,
}
func Execute(services *service.Services) error {
svc = services
rootCmd.Use = svc.Config.RootCmd
return rootCmd.Execute()
}
func init() {
rootCmd.AddCommand(createCmd)
rootCmd.CompletionOptions.DisableDefaultCmd = false
rootCmd.AddGroup(&cobra.Group{ID: "other", Title: "Helping Commands"})
rootCmd.SetCompletionCommandGroupID("other")
rootCmd.SetHelpCommandGroupID("other")
rootCmd.AddGroup(&cobra.Group{ID: "help", Title: "Helping Commands"})
rootCmd.SetCompletionCommandGroupID("help")
rootCmd.SetHelpCommandGroupID("help")
}