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 | |
---|
1 | package cmd
|
---|
2 |
|
---|
3 | import (
|
---|
4 | "os"
|
---|
5 |
|
---|
6 | "github.com/spf13/cobra"
|
---|
7 | )
|
---|
8 |
|
---|
9 | var 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 |
|
---|
16 | var (
|
---|
17 | format string
|
---|
18 | region string
|
---|
19 | )
|
---|
20 |
|
---|
21 | func Execute() {
|
---|
22 | err := rootCmd.Execute()
|
---|
23 | if err != nil {
|
---|
24 | os.Exit(1)
|
---|
25 | }
|
---|
26 | }
|
---|
27 |
|
---|
28 | func init() {
|
---|
29 | rootCmd.PersistentFlags().StringVarP(&format, "format", "f", "AT", "View options")
|
---|
30 | rootCmd.PersistentFlags().StringVarP(®ion, "region", "r", "", "Which location do you want to consult?")
|
---|
31 | }
|
---|
32 |
|
---|
33 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.