Skip to content

Commit 6cd5acb

Browse files
committed
Add 'version' command
1 parent 5822055 commit 6cd5acb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Diff for: cmd/version.go

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package cmd
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/spf13/cobra"
7+
)
8+
9+
var version = "0.7.0"
10+
11+
var versionCmd = &cobra.Command{
12+
Use: "version",
13+
Short: "Show version",
14+
Long: `Show uptimerobot client version`,
15+
Run: func(cmd *cobra.Command, args []string) {
16+
fmt.Println("uptimerobot version", version)
17+
},
18+
}
19+
20+
func init() {
21+
RootCmd.AddCommand(versionCmd)
22+
}

0 commit comments

Comments
 (0)