Merge pull request #965 from thaJeztah/fix-version-output

Fix docker version output alignment
This commit is contained in:
Vincent Demeester 2018-03-28 09:53:34 +02:00 committed by GitHub
commit eb4a4fe9b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"runtime" "runtime"
"sort" "sort"
"text/tabwriter"
"text/template" "text/template"
"time" "time"
@ -200,11 +201,12 @@ func runVersion(dockerCli command.Cli, opts *versionOptions) error {
}) })
} }
} }
t := tabwriter.NewWriter(dockerCli.Out(), 15, 1, 1, ' ', 0)
if err2 := tmpl.Execute(dockerCli.Out(), vd); err2 != nil && err == nil { if err2 := tmpl.Execute(t, vd); err2 != nil && err == nil {
err = err2 err = err2
} }
dockerCli.Out().Write([]byte{'\n'}) t.Write([]byte("\n"))
t.Flush()
return err return err
} }