areweplaying/cmd/cli/cmd/root.go
Harry Culpan fc5c986141 Consolidate log file env vars: AWP_LOG_FILE (web) and AWP_CLI_LOG_FILE (CLI)
Removes the duplicate log setup from cli/cmd/root.go that was reading
AWP_LOG_FILE — log file config now lives only in each binary's main.go.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-30 19:57:46 -04:00

30 lines
562 B
Go

package cmd
import (
"os"
"github.com/joho/godotenv"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "awp-cli",
Short: "CLI utility for Are We Playing? web app",
Long: `CLI utility for Are We Playing? web app`,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
godotenv.Load()
return nil
},
}
func Execute() {
err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
}
func init() {
rootCmd.CompletionOptions.DisableDefaultCmd = true
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}