mirror of
https://github.com/casbin/bee.git
synced 2025-07-17 19:44:21 +08:00
New Bee banner
Added a new Bee banner using ASCII art. When bee is invoked, the banner is displayed with the version number (short banner). A More verbose Banner is added to 'bee version' which shows more information about the host and Go runtime.
This commit is contained in:
11
g.go
11
g.go
@ -14,7 +14,10 @@
|
||||
|
||||
package main
|
||||
|
||||
import "os"
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var cmdGenerate = &Command{
|
||||
UsageLine: "generate [Command]",
|
||||
@ -74,6 +77,8 @@ func init() {
|
||||
}
|
||||
|
||||
func generateCode(cmd *Command, args []string) int {
|
||||
ShowShortVersionBanner()
|
||||
|
||||
curpath, _ := os.Getwd()
|
||||
if len(args) < 1 {
|
||||
ColorLog("[ERRO] command is missing\n")
|
||||
@ -119,7 +124,6 @@ func generateCode(cmd *Command, args []string) int {
|
||||
os.Exit(2)
|
||||
}
|
||||
sname := args[1]
|
||||
ColorLog("[INFO] Using '%s' as scaffold name\n", sname)
|
||||
generateScaffold(sname, fields.String(), curpath, driver.String(), conn.String())
|
||||
case "docs":
|
||||
generateDocs(curpath)
|
||||
@ -192,7 +196,6 @@ func generateCode(cmd *Command, args []string) int {
|
||||
os.Exit(2)
|
||||
}
|
||||
sname := args[1]
|
||||
ColorLog("[INFO] Using '%s' as model name\n", sname)
|
||||
generateModel(sname, fields.String(), curpath)
|
||||
case "view":
|
||||
if len(args) == 2 {
|
||||
@ -206,6 +209,6 @@ func generateCode(cmd *Command, args []string) int {
|
||||
default:
|
||||
ColorLog("[ERRO] command is missing\n")
|
||||
}
|
||||
ColorLog("[SUCC] generate successfully created!\n")
|
||||
ColorLog("[SUCC] %s successfully generated!\n", strings.Title(gcmd))
|
||||
return 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user