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