Add the git commit to the output version

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2016-03-18 15:29:22 -07:00
parent 7146b01a3d
commit febace3633
4 changed files with 19 additions and 4 deletions

View file

@ -14,7 +14,11 @@ const usage = `High performance container daemon cli`
func main() {
app := cli.NewApp()
app.Name = "ctr"
app.Version = containerd.Version
if containerd.GitCommit != "" {
app.Version = fmt.Sprintf("%s commit: %s", containerd.Version, containerd.GitCommit)
} else {
app.Version = containerd.Version
}
app.Usage = usage
app.Flags = []cli.Flag{
cli.BoolFlag{