Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package cmd |
||
2 | |||
3 | import ( |
||
4 | "fmt" |
||
5 | "github.com/SerhiiCho/shoshka-go/utils" |
||
6 | "github.com/spf13/cobra" |
||
7 | "os" |
||
8 | ) |
||
9 | |||
10 | var rootCmd = &cobra.Command{ |
||
11 | Use: "shoshka-go", |
||
12 | Short: "Shoshka is a telegram bot that checks for things like server log files, the state of the server and couple other things.", |
||
13 | Run: func(cmd *cobra.Command, args []string) { |
||
14 | err := cmd.Usage() |
||
15 | utils.HandleError(err, "Error with cmd.Usage command") |
||
16 | }, |
||
17 | } |
||
18 | |||
19 | // Execute register the root command |
||
20 | func Execute() { |
||
21 | if err := rootCmd.Execute(); err != nil { |
||
22 | fmt.Println(err) |
||
23 | os.Exit(1) |
||
24 | } |
||
26 |