Merge pull request #571 from stevvooe/use-init-func

cmd/dist: consistently replace version string
This commit is contained in:
Michael Crosby 2017-02-24 16:33:13 -08:00 committed by GitHub
commit e04df4e3e5

8
cmd/dist/main.go vendored
View file

@ -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