1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #23316 from dnephin/error_on_invalid_docker_host

Fix a panic when the DOCKER_HOST was invalid using cobra commands
This commit is contained in:
Brian Goff 2016-06-06 21:17:47 -04:00
commit c077d4cc1e

View file

@ -72,7 +72,9 @@ func (c CobraAdaptor) Usage() []cli.Command {
}
func (c CobraAdaptor) run(cmd string, args []string) error {
c.dockerCli.Initialize()
if err := c.dockerCli.Initialize(); err != nil {
return err
}
// Prepend the command name to support normal cobra command delegation
c.rootCmd.SetArgs(append([]string{cmd}, args...))
return c.rootCmd.Execute()