(streams command.Streams, info dockerInfo)
| 186 | } |
| 187 | |
| 188 | func prettyPrintInfo(streams command.Streams, info dockerInfo) error { |
| 189 | // Only append the platform info if it's not empty, to prevent printing a trailing space. |
| 190 | if p := info.clientPlatform(); p != "" { |
| 191 | fprintln(streams.Out(), "Client:", p) |
| 192 | } else { |
| 193 | fprintln(streams.Out(), "Client:") |
| 194 | } |
| 195 | if info.ClientInfo != nil { |
| 196 | prettyPrintClientInfo(streams, *info.ClientInfo) |
| 197 | } |
| 198 | for _, err := range info.ClientErrors { |
| 199 | fprintln(streams.Err(), "ERROR:", err) |
| 200 | } |
| 201 | |
| 202 | fprintln(streams.Out()) |
| 203 | fprintln(streams.Out(), "Server:") |
| 204 | if info.Info != nil { |
| 205 | prettyPrintServerInfo(streams, &info) |
| 206 | } |
| 207 | for _, err := range info.ServerErrors { |
| 208 | fprintln(streams.Err(), "ERROR:", err) |
| 209 | } |
| 210 | |
| 211 | if len(info.ServerErrors) > 0 || len(info.ClientErrors) > 0 { |
| 212 | return errors.New("errors pretty printing info") |
| 213 | } |
| 214 | return nil |
| 215 | } |
| 216 | |
| 217 | func prettyPrintClientInfo(streams command.Streams, info clientInfo) { |
| 218 | fprintlnNonEmpty(streams.Out(), " Version: ", info.Version) |
searching dependent graphs…