commands: add version command
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>pull/47/head
parent
e7e57b626d
commit
6abbf0ee76
@ -0,0 +1,27 @@
|
|||||||
|
package commands
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/docker/cli/cli"
|
||||||
|
"github.com/docker/cli/cli/command"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/tonistiigi/buildx/version"
|
||||||
|
)
|
||||||
|
|
||||||
|
func runVersion(dockerCli command.Cli) error {
|
||||||
|
fmt.Println(version.Package, version.Version, version.Revision)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func versionCmd(dockerCli command.Cli) *cobra.Command {
|
||||||
|
cmd := &cobra.Command{
|
||||||
|
Use: "version",
|
||||||
|
Short: "Show buildx version information ",
|
||||||
|
Args: cli.ExactArgs(0),
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
return runVersion(dockerCli)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return cmd
|
||||||
|
}
|
Loading…
Reference in New Issue