From 5f7638400e935a85ddd2458853caf751f0cd6502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Meireles?= Date: Tue, 12 Jan 2016 16:19:01 +0000 Subject: [PATCH] tweak 'ls -a' output (omit channels with no local images) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: António Meireles --- list.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/list.go b/list.go index 51871d1..7a5f83f 100644 --- a/list.go +++ b/list.go @@ -70,8 +70,12 @@ func lsCommand(cmd *cobra.Command, args []string) (err error) { } fmt.Println("locally available images") for _, i := range channels { - fmt.Printf(" - %s channel \n", i) + var header bool for _, d := range local[i] { + if !header { + fmt.Printf(" - %s channel \n", i) + header = true + } fmt.Println(" -", d.String()) } }