cmd.Execute   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 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
	}
25
}
26