use new rootCmd name var

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

View File

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

View File

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