This commit is contained in:
Robin Olsen
2026-02-06 13:26:26 +01:00
parent 80741e0cf5
commit fbcc929cb9

View File

@@ -1,7 +1,11 @@
package commands package commands
import ( import (
"context"
"os"
"github.com/LazyBachelor/LazyPM/internal/service" "github.com/LazyBachelor/LazyPM/internal/service"
"github.com/charmbracelet/fang"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@@ -15,7 +19,9 @@ var rootCmd = &cobra.Command{
func Execute(services *service.Services) error { func Execute(services *service.Services) error {
SetServices(services) SetServices(services)
return rootCmd.Execute() return fang.Execute(context.Background(), rootCmd,
fang.WithColorSchemeFunc(fang.AnsiColorScheme),
fang.WithNotifySignal(os.Interrupt, os.Kill))
} }
func SetServices(services *service.Services) { func SetServices(services *service.Services) {
@@ -25,7 +31,8 @@ func SetServices(services *service.Services) {
func ExecuteWithArgs(args []string) error { func ExecuteWithArgs(args []string) error {
rootCmd.SetArgs(args) rootCmd.SetArgs(args)
return rootCmd.Execute() return fang.Execute(context.Background(), rootCmd,
fang.WithColorSchemeFunc(fang.AnsiColorScheme))
} }
func init() { func init() {