Ai
1 Star 0 Fork 0

powerpaas/machine

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
version.go 650 Bytes
Copy Edit Raw Blame History
David Gageot authored 2015-12-23 19:20 +08:00 . FIX #2663 reduce calls to the driver in ls
package commands
import (
"fmt"
"io"
"os"
"github.com/docker/machine/libmachine"
"github.com/docker/machine/libmachine/mcndockerclient"
)
func cmdVersion(c CommandLine, api libmachine.API) error {
return printVersion(c, api, os.Stdout)
}
func printVersion(c CommandLine, api libmachine.API, out io.Writer) error {
if len(c.Args()) == 0 {
c.ShowVersion()
return nil
}
if len(c.Args()) != 1 {
return ErrExpectedOneMachine
}
host, err := api.Load(c.Args().First())
if err != nil {
return err
}
version, err := mcndockerclient.DockerVersion(host)
if err != nil {
return err
}
fmt.Fprintln(out, version)
return nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/powerpaas/machine.git
git@gitee.com:powerpaas/machine.git
powerpaas
machine
machine
v0.13.0

Search