mirror of https://github.com/docker/cli.git
Fix docker version output alignment
Use tabwriter to print the version output Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
a6d235430a
commit
48eb7a082d
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sort"
|
"sort"
|
||||||
|
"text/tabwriter"
|
||||||
"text/template"
|
"text/template"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -195,11 +196,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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue