add stub for help

This commit is contained in:
Nate Jones 2015-08-17 19:44:02 -07:00
parent c4fa776981
commit 7b58366a10
3 changed files with 24 additions and 2 deletions

View file

@ -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

22
help.go Normal file
View file

@ -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)
}

View file

@ -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