mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +00:00
Bump libcompose and its dependencies
This commit is contained in:
52
vendor/github.com/docker/libcompose/cli/app/version.go
generated
vendored
Normal file
52
vendor/github.com/docker/libcompose/cli/app/version.go
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"text/template"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/docker/libcompose/version"
|
||||
)
|
||||
|
||||
var versionTemplate = `Version: {{.Version}} ({{.GitCommit}})
|
||||
Go version: {{.GoVersion}}
|
||||
Built: {{.BuildTime}}
|
||||
OS/Arch: {{.Os}}/{{.Arch}}`
|
||||
|
||||
// Version prints the libcompose version number and additionnal informations.
|
||||
func Version(c *cli.Context) {
|
||||
if c.Bool("short") {
|
||||
fmt.Println(version.VERSION)
|
||||
return
|
||||
}
|
||||
|
||||
tmpl, err := template.New("").Parse(versionTemplate)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
v := struct {
|
||||
Version string
|
||||
GitCommit string
|
||||
GoVersion string
|
||||
BuildTime string
|
||||
Os string
|
||||
Arch string
|
||||
}{
|
||||
Version: version.VERSION,
|
||||
GitCommit: version.GITCOMMIT,
|
||||
GoVersion: runtime.Version(),
|
||||
BuildTime: version.BUILDTIME,
|
||||
Os: runtime.GOOS,
|
||||
Arch: runtime.GOARCH,
|
||||
}
|
||||
|
||||
if err := tmpl.Execute(os.Stdout, v); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
fmt.Printf("\n")
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user