mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #16484 from HuKeping/history-format
Format the output of docker history
This commit is contained in:
commit
d71ae45772
1 changed files with 3 additions and 2 deletions
|
@ -3,6 +3,7 @@ package client
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
"text/tabwriter"
|
||||
"time"
|
||||
|
||||
|
@ -57,9 +58,9 @@ func (cli *DockerCli) CmdHistory(args ...string) error {
|
|||
}
|
||||
|
||||
if *noTrunc {
|
||||
fmt.Fprintf(w, "%s\t", entry.CreatedBy)
|
||||
fmt.Fprintf(w, "%s\t", strings.Replace(entry.CreatedBy, "\t", " ", -1))
|
||||
} else {
|
||||
fmt.Fprintf(w, "%s\t", stringutils.Truncate(entry.CreatedBy, 45))
|
||||
fmt.Fprintf(w, "%s\t", stringutils.Truncate(strings.Replace(entry.CreatedBy, "\t", " ", -1), 45))
|
||||
}
|
||||
|
||||
if *human {
|
||||
|
|
Loading…
Add table
Reference in a new issue