forked from wyx2685/ppanel-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion.go
More file actions
37 lines (31 loc) · 717 Bytes
/
version.go
File metadata and controls
37 lines (31 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
var (
version = "TempVersion" //use ldflags replace
codename = "PPanel-node"
intro = "A PPanel backend based on multi core"
)
var versionCommand = cobra.Command{
Use: "version",
Short: "Print version info",
Run: func(_ *cobra.Command, _ []string) {
showVersion()
},
}
func init() {
command.AddCommand(&versionCommand)
}
func showVersion() {
fmt.Println(`
______ ______ _
| ___ \| ___ \ | |
| |_/ /| |_/ /__ _ _ __ ___ | |
| __/ | __// _ || _ \ / _ \| |
| | | | | (_| || | | || __/| |
\_| \_| \__,_||_| |_| \___||_|
`)
fmt.Printf("%s %s (%s) \n", codename, version, intro)
}