1
0
mirror of https://github.com/rancher/os.git synced 2025-07-30 22:24:33 +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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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]