mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
remove column size hack
This commit is contained in:
parent
747967b4a4
commit
854cc5f559
1 changed files with 2 additions and 8 deletions
10
commands.go
10
commands.go
|
@ -1429,20 +1429,14 @@ func (cli *DockerCli) CmdSearch(args ...string) error {
|
|||
}
|
||||
w := tabwriter.NewWriter(cli.out, 10, 1, 3, ' ', 0)
|
||||
fmt.Fprintf(w, "NAME\tDESCRIPTION\tSTARS\tOFFICIAL\tTRUSTED\n")
|
||||
_, width := cli.getTtySize()
|
||||
if width == 0 {
|
||||
width = 45
|
||||
} else {
|
||||
width = width - 10 - 54 //remote the first column
|
||||
}
|
||||
for _, out := range outs {
|
||||
if (*trusted && !out.IsTrusted) || (*stars > out.StarCount) {
|
||||
continue
|
||||
}
|
||||
desc := strings.Replace(out.Description, "\n", " ", -1)
|
||||
desc = strings.Replace(desc, "\r", " ", -1)
|
||||
if !*noTrunc && len(desc) > width {
|
||||
desc = utils.Trunc(desc, width-3) + "..."
|
||||
if !*noTrunc && len(desc) > 45 {
|
||||
desc = utils.Trunc(desc, 42) + "..."
|
||||
}
|
||||
fmt.Fprintf(w, "%s\t%s\t%d\t", out.Name, desc, out.StarCount)
|
||||
if out.IsOfficial {
|
||||
|
|
Loading…
Add table
Reference in a new issue