refactor: Remove root cmd

Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
This commit is contained in:
Tim Hårek Andreassen 2024-10-18 09:38:21 +02:00
parent df389705a0
commit 7388a1b893
No known key found for this signature in database
GPG key ID: E59C7734F0E10EB5

View file

@ -9,7 +9,6 @@ import (
var rootCmd = &cobra.Command{ var rootCmd = &cobra.Command{
Use: "yr", Use: "yr",
Short: "yr is CLI tool for weather forecasts", Short: "yr is CLI tool for weather forecasts",
Run: root,
} }
func Execute() { func Execute() {
@ -36,12 +35,3 @@ func init() {
rootCmd.PersistentFlags().Float64VarP(&lon, "lon", "x", 0, "Longitude coordinate") rootCmd.PersistentFlags().Float64VarP(&lon, "lon", "x", 0, "Longitude coordinate")
rootCmd.PersistentFlags().Float64VarP(&lat, "lat", "y", 0, "Latitude coordinate") rootCmd.PersistentFlags().Float64VarP(&lat, "lat", "y", 0, "Latitude coordinate")
} }
func root(cmd *cobra.Command, args []string) {
if isWeb {
openBrowser("https://www.yr.no/en", nil)
}
err := cmd.Help()
cobra.CheckErr(err)
}