mirror of
https://github.com/beego/bee.git
synced 2024-11-25 15:00:55 +00:00
bee support version command
This commit is contained in:
parent
244f27afdf
commit
226b5d4f4d
3
bee.go
3
bee.go
@ -25,6 +25,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const version = "1.0.1"
|
||||||
|
|
||||||
type Command struct {
|
type Command struct {
|
||||||
// Run runs the command.
|
// Run runs the command.
|
||||||
// The args are the arguments after the command name.
|
// The args are the arguments after the command name.
|
||||||
@ -78,6 +80,7 @@ var commands = []*Command{
|
|||||||
cmdRouter,
|
cmdRouter,
|
||||||
cmdTest,
|
cmdTest,
|
||||||
cmdBale,
|
cmdBale,
|
||||||
|
cmdVersion,
|
||||||
//cmdReStart,
|
//cmdReStart,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
28
version.go
Normal file
28
version.go
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/astaxie/beego"
|
||||||
|
)
|
||||||
|
|
||||||
|
var cmdVersion = &Command{
|
||||||
|
UsageLine: "version",
|
||||||
|
Short: "show the bee & beego version",
|
||||||
|
Long: `
|
||||||
|
show the bee & beego version
|
||||||
|
|
||||||
|
bee version
|
||||||
|
bee: 1.1.1
|
||||||
|
beego: 1.2
|
||||||
|
`,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
cmdVersion.Run = versionCmd
|
||||||
|
}
|
||||||
|
|
||||||
|
func versionCmd(cmd *Command, args []string) {
|
||||||
|
fmt.Println("bee:" + version)
|
||||||
|
fmt.Println("beego:" + beego.VERSION)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user