From 854cc5f55992b8bb200f470b11896a0b3cb68d4e Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Mon, 4 Nov 2013 15:34:51 -0800 Subject: [PATCH] remove column size hack --- commands.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/commands.go b/commands.go index 51733035c2..e5291ec94e 100644 --- a/commands.go +++ b/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 {