From 1cdf9dc834e7c523c812f58ca93fc10a99bcce78 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Fri, 24 Feb 2017 16:09:19 -0800 Subject: [PATCH] cmd/dist: consistently replace version string A previous PR placed the version string replacement in the `init` function in the other commands. This makes this same change consistently in the `dist` tool. Signed-off-by: Stephen J Day --- cmd/dist/main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/dist/main.go b/cmd/dist/main.go index fab369c..c5473ca 100644 --- a/cmd/dist/main.go +++ b/cmd/dist/main.go @@ -14,10 +14,14 @@ var ( background = contextpkg.Background() ) -func main() { +func init() { cli.VersionPrinter = func(c *cli.Context) { - fmt.Println(os.Args[0], containerd.Package, containerd.Version) + fmt.Println(c.App.Name, containerd.Package, c.App.Version) } + +} + +func main() { app := cli.NewApp() app.Name = "dist" app.Version = containerd.Version