1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 14:48:55 +00:00

Report image version when using ros version subcommand (#2213)

This commit is contained in:
niusmallnan
2018-01-08 17:58:43 +08:00
committed by GitHub
parent 8b196aaf35
commit 480e45cd01

View File

@@ -12,6 +12,11 @@ import (
func Main() {
log.InitLogger()
cli.VersionPrinter = func(c *cli.Context) {
cfg := config.LoadConfig()
runningName := cfg.Rancher.Upgrade.Image + ":" + config.Version
fmt.Fprintf(c.App.Writer, "version %s from os image %s\n", c.App.Version, runningName)
}
app := cli.NewApp()
app.Name = os.Args[0]