package cmd import ( "os" "github.com/spf13/cobra" ) var rootCmd = &cobra.Command{ Use: "yuuka", Short: "Weather forecast client backed by wttr.in", Long: `This client currently supports showing the weather forecast and moon phases`, Version: "0.1.2", } var ( format string region string ) func Execute() { err := rootCmd.Execute() if err != nil { os.Exit(1) } } func init() { rootCmd.PersistentFlags().StringVarP(&format, "format", "f", "AT", "View options") rootCmd.PersistentFlags().StringVarP(®ion, "region", "r", "", "Which location do you want to consult?") }