commit
d22af706bf
|
@ -608,20 +608,20 @@ func (c *CommandLine) writeCSV(response *client.Response, w io.Writer) {
|
|||
}
|
||||
|
||||
func (c *CommandLine) writeColumns(response *client.Response, w io.Writer) {
|
||||
// Create a tabbed writer for each result as they won't always line up
|
||||
writer := new(tabwriter.Writer)
|
||||
writer.Init(w, 0, 8, 1, '\t', 0)
|
||||
|
||||
for _, result := range response.Results {
|
||||
// Print out all messages first
|
||||
for _, m := range result.Messages {
|
||||
fmt.Fprintf(w, "%s: %s.\n", m.Level, m.Text)
|
||||
}
|
||||
|
||||
// Create a tabbed writer for each result as they won't always line up
|
||||
w := new(tabwriter.Writer)
|
||||
w.Init(os.Stdout, 0, 8, 1, '\t', 0)
|
||||
csv := c.formatResults(result, "\t")
|
||||
for _, r := range csv {
|
||||
fmt.Fprintln(w, r)
|
||||
fmt.Fprintln(writer, r)
|
||||
}
|
||||
w.Flush()
|
||||
writer.Flush()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue