Yeah, I kinda gave up, i will fix it later or something I recon

This commit is contained in:
2026-02-09 23:23:45 +00:00
parent 2952ec7085
commit 97caeafd58
16 changed files with 464 additions and 103 deletions
+8 -1
View File
@@ -2,6 +2,8 @@
package cmd
import (
"context"
"log/slog"
"os"
"github.com/spf13/cobra"
@@ -14,9 +16,14 @@ var rootCmd = &cobra.Command{
Long: `Allows the configuration and communication with the dashDisplay`,
}
type loggerKey struct{}
// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
func Execute(log *slog.Logger) {
ctx := context.WithValue(context.Background(), loggerKey{}, log)
rootCmd.SetContext(ctx)
err := rootCmd.Execute()
if err != nil {
os.Exit(1)