add stub for help
This commit is contained in:
parent
c4fa776981
commit
7b58366a10
3 changed files with 24 additions and 2 deletions
|
@ -57,7 +57,7 @@ func (x *ContainersCommand) Execute(args []string) error {
|
||||||
|
|
||||||
clientContainers, err := client.ListContainers(docker.ListContainersOptions{All: true})
|
clientContainers, err := client.ListContainers(docker.ListContainersOptions{All: true})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("Unable to connect: %s\nFor help, run 'dockviz help'", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var conts []Container
|
var conts []Container
|
||||||
|
|
22
help.go
Normal file
22
help.go
Normal 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)
|
||||||
|
}
|
|
@ -59,7 +59,7 @@ func (x *ImagesCommand) Execute(args []string) error {
|
||||||
|
|
||||||
clientImages, err := client.ListImages(docker.ListImagesOptions{All: true})
|
clientImages, err := client.ListImages(docker.ListImagesOptions{All: true})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("Unable to connect: %s\nFor help, run 'dockviz help'", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var ims []Image
|
var ims []Image
|
||||||
|
|
Loading…
Reference in a new issue