From 7b58366a10fdb0c57f94f96cf519cc4118684d16 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Mon, 17 Aug 2015 19:44:02 -0700 Subject: [PATCH] add stub for help --- containers.go | 2 +- help.go | 22 ++++++++++++++++++++++ images.go | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 help.go diff --git a/containers.go b/containers.go index 2029a42..2db8415 100644 --- a/containers.go +++ b/containers.go @@ -57,7 +57,7 @@ func (x *ContainersCommand) Execute(args []string) error { clientContainers, err := client.ListContainers(docker.ListContainersOptions{All: true}) if err != nil { - return err + return fmt.Errorf("Unable to connect: %s\nFor help, run 'dockviz help'", err) } var conts []Container diff --git a/help.go b/help.go new file mode 100644 index 0000000..a03ad06 --- /dev/null +++ b/help.go @@ -0,0 +1,22 @@ +package main + +import "fmt" + +type HelpCommand struct { + // nothing yet +} + +var helpCommand HelpCommand + +func (x *HelpCommand) Execute(args []string) error { + fmt.Println("stub help is here") + + return nil +} + +func init() { + parser.AddCommand("help", + "Help for this tool.", + "", + &helpCommand) +} diff --git a/images.go b/images.go index bfe3289..605f323 100644 --- a/images.go +++ b/images.go @@ -59,7 +59,7 @@ func (x *ImagesCommand) Execute(args []string) error { clientImages, err := client.ListImages(docker.ListImagesOptions{All: true}) if err != nil { - return err + return fmt.Errorf("Unable to connect: %s\nFor help, run 'dockviz help'", err) } var ims []Image