mirror of
https://github.com/casbin/bee.git
synced 2025-07-18 00:14:19 +08:00
Set the output format for bee version
This adds the ability to set the output format (using -o flag) of bee version command. It supports both JSON and YAML formats.
This commit is contained in:
@ -8,7 +8,8 @@ import (
|
||||
"text/template"
|
||||
)
|
||||
|
||||
type vars struct {
|
||||
// RuntimeInfo holds information about the current runtime.
|
||||
type RuntimeInfo struct {
|
||||
GoVersion string
|
||||
GOOS string
|
||||
GOARCH string
|
||||
@ -45,7 +46,7 @@ func show(out io.Writer, content string) {
|
||||
logger.Fatalf("Cannot parse the banner template: %s", err)
|
||||
}
|
||||
|
||||
err = t.Execute(out, vars{
|
||||
err = t.Execute(out, RuntimeInfo{
|
||||
getGoVersion(),
|
||||
runtime.GOOS,
|
||||
runtime.GOARCH,
|
||||
|
Reference in New Issue
Block a user