d5eba1904e
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
24 lines
373 B
Go
24 lines
373 B
Go
package cmd
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var rootCmd = &cobra.Command{
|
|
Use: "yr",
|
|
Short: "Get the weather for your desired location.",
|
|
Long: `Get the weather for your desired location.`,
|
|
}
|
|
|
|
func Execute() {
|
|
err := rootCmd.Execute()
|
|
if err != nil {
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.PersistentFlags().Bool("json", false, "Result in JSON")
|
|
}
|