From 66470aa06e2c514ef237c8eb3874b08810a804c6 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Mon, 12 May 2014 20:30:39 -0700 Subject: [PATCH] cleanup options and print error if no viz selected --- images.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/images.go b/images.go index 7b79aa9..39ad648 100644 --- a/images.go +++ b/images.go @@ -21,7 +21,7 @@ type Image struct { type ImagesCommand struct { Dot bool `short:"d" long:"dot" description:"Show image information as Graphviz dot."` Tree bool `short:"t" long:"tree" description:"Show image information as tree."` - NoTruncate bool `short:"n" long:"notrunc" description:"Don't truncate the image IDs."` + NoTruncate bool `short:"n" long:"no-trunc" description:"Don't truncate the image IDs."` } var imagesCommand ImagesCommand @@ -46,6 +46,8 @@ func (x *ImagesCommand) Execute(args []string) error { } fmt.Printf(jsonToTree(images, startImageArg, imagesCommand.NoTruncate)) + } else { + return fmt.Errorf("Please specify either --dot or --tree") } return nil