fix stdout and stderr in api client

Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
allencloud 2016-07-04 12:02:56 +08:00
parent dc31f4f6db
commit 533bd82e41
5 changed files with 8 additions and 5 deletions

View File

@ -33,7 +33,7 @@ func runRemove(dockerCli *client.DockerCli, networks []string) error {
status = 1
continue
}
fmt.Fprintf(dockerCli.Err(), "%s\n", name)
fmt.Fprintf(dockerCli.Out(), "%s\n", name)
}
if status != 0 {

View File

@ -45,7 +45,7 @@ func runLogout(dockerCli *client.DockerCli, serverAddress string) error {
fmt.Fprintf(dockerCli.Out(), "Remove login credentials for %s\n", serverAddress)
if err := client.EraseCredentials(dockerCli.ConfigFile(), serverAddress); err != nil {
fmt.Fprintf(dockerCli.Out(), "WARNING: could not erase credentials: %v\n", err)
fmt.Fprintf(dockerCli.Err(), "WARNING: could not erase credentials: %v\n", err)
}
return nil

View File

@ -56,6 +56,8 @@ func runInit(dockerCli *client.DockerCli, flags *pflag.FlagSet, opts initOptions
if err != nil {
return err
}
fmt.Printf("Swarm initialized: current node (%s) is now a manager.\n", nodeID)
fmt.Fprintf(dockerCli.Out(), "Swarm initialized: current node (%s) is now a manager.\n", nodeID)
return nil
}

View File

@ -47,7 +47,8 @@ func runUpdate(dockerCli *client.DockerCli, flags *pflag.FlagSet, opts swarmOpti
return err
}
fmt.Println("Swarm updated.")
fmt.Fprintln(dockerCli.Out(), "Swarm updated.")
return nil
}

View File

@ -33,7 +33,7 @@ func runRemove(dockerCli *client.DockerCli, volumes []string) error {
status = 1
continue
}
fmt.Fprintf(dockerCli.Err(), "%s\n", name)
fmt.Fprintf(dockerCli.Out(), "%s\n", name)
}
if status != 0 {