use new rootCmd name var
This commit is contained in:
@@ -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",
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user