1 Star 0 Fork 0

zhangjungang/beats

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
version.go 668 Bytes
Copy Edit Raw Blame History
Silvia Mitter authored 2017-09-18 20:18 +08:00 . Allow IndexPrefix to be set. (#5161)
package cmd
import (
"fmt"
"os"
"runtime"
"github.com/spf13/cobra"
"github.com/elastic/beats/libbeat/cmd/instance"
"github.com/elastic/beats/libbeat/version"
)
func genVersionCmd(name, beatVersion string) *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "Show current version info",
Run: func(cmd *cobra.Command, args []string) {
beat, err := instance.NewBeat(name, "", beatVersion)
if err != nil {
fmt.Fprintf(os.Stderr, "Error initializing beat: %s\n", err)
os.Exit(1)
}
fmt.Printf("%s version %s (%s), libbeat %s\n",
beat.Info.Beat, beat.Info.Version, runtime.GOARCH, version.GetDefaultVersion())
},
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangjungang/beats.git
git@gitee.com:zhangjungang/beats.git
zhangjungang
beats
beats
v6.1.2

Search