You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
579 B
Go
28 lines
579 B
Go
6 years ago
|
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
|
||
|
}
|