cmd/{dist, ctr}: cleanup flushing and alignment

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2017-06-16 14:42:40 -07:00
parent b4b16a1d45
commit 5d13f8027c
No known key found for this signature in database
GPG Key ID: 67B3DED84EDC823F
4 changed files with 8 additions and 11 deletions

View File

@ -84,10 +84,8 @@ var listCommand = cli.Command{
); err != nil { ); err != nil {
return err return err
} }
if err := w.Flush(); err != nil {
return err
}
} }
return nil
return w.Flush()
}, },
} }

View File

@ -156,7 +156,8 @@ var namespacesListCommand = cli.Command{
fmt.Fprintf(tw, "%v\t%v\t\n", ns, strings.Join(labelStrings, ",")) fmt.Fprintf(tw, "%v\t%v\t\n", ns, strings.Join(labelStrings, ","))
} }
tw.Flush()
return tw.Flush()
} }
return nil return nil

7
cmd/dist/active.go vendored
View File

@ -46,15 +46,14 @@ var activeCommand = cli.Command{
} }
tw := tabwriter.NewWriter(os.Stdout, 1, 8, 1, '\t', 0) tw := tabwriter.NewWriter(os.Stdout, 1, 8, 1, '\t', 0)
fmt.Fprintln(tw, "REF\tSIZE\tAGE") fmt.Fprintln(tw, "REF\tSIZE\tAGE\t")
for _, active := range active { for _, active := range active {
fmt.Fprintf(tw, "%s\t%s\t%s\n", fmt.Fprintf(tw, "%s\t%s\t%s\t\n",
active.Ref, active.Ref,
units.HumanSize(float64(active.Offset)), units.HumanSize(float64(active.Offset)),
units.HumanDuration(time.Since(active.StartedAt))) units.HumanDuration(time.Since(active.StartedAt)))
} }
tw.Flush()
return nil return tw.Flush()
}, },
} }

3
cmd/dist/images.go vendored
View File

@ -57,9 +57,8 @@ var imagesListCommand = cli.Command{
fmt.Fprintf(tw, "%v\t%v\t%v\t%v\t\n", image.Name, image.Target.MediaType, image.Target.Digest, progress.Bytes(size)) fmt.Fprintf(tw, "%v\t%v\t%v\t%v\t\n", image.Name, image.Target.MediaType, image.Target.Digest, progress.Bytes(size))
} }
tw.Flush()
return nil return tw.Flush()
}, },
} }