source: code/trunk/cmd/root.go

Last change on this file was 3, checked in by Izuru Yakumo, 5 weeks ago

You humans are so full of yourselves. If you want to live a long life, then you should be a little more quiet.

File size: 594 bytes
Line 
1package cmd
2
3import (
4 "os"
5
6 "github.com/spf13/cobra"
7)
8
9var rootCmd = &cobra.Command{
10 Use: "yuuka",
11 Short: "Weather forecast client backed by wttr.in",
12 Long: `This client currently supports showing the weather forecast and moon phases`,
13 Version: "0.1.2",
14}
15
16var (
17 format string
18 region string
19)
20
21func Execute() {
22 err := rootCmd.Execute()
23 if err != nil {
24 os.Exit(1)
25 }
26}
27
28func init() {
29 rootCmd.PersistentFlags().StringVarP(&format, "format", "f", "AT", "View options")
30 rootCmd.PersistentFlags().StringVarP(&region, "region", "r", "", "Which location do you want to consult?")
31}
32
33
Note: See TracBrowser for help on using the repository browser.