initial skeleton

This commit is contained in:
Nate Jones 2014-04-21 09:30:55 -07:00
parent b71347fbb6
commit 9155320da8
3 changed files with 50 additions and 0 deletions

2
.gitignore vendored
View file

@ -21,3 +21,5 @@ _testmain.go
*.exe
*.test
dockviz*

20
cli.go Normal file
View file

@ -0,0 +1,20 @@
package main
import (
"os"
"github.com/jessevdk/go-flags"
)
type GlobalOptions struct {
// no options yet
}
var globalOptions GlobalOptions
var parser = flags.NewParser(&globalOptions, flags.Default)
func main() {
if _, err := parser.Parse(); err != nil {
os.Exit(1)
}
}

28
images.go Normal file
View file

@ -0,0 +1,28 @@
package main
import "fmt"
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."`
}
var imagesCommand ImagesCommand
func (x *ImagesCommand) Execute(args []string) error {
if imagesCommand.Dot {
fmt.Println("Output dot")
} else if imagesCommand.Tree {
fmt.Println("Output tree")
}
return nil
}
func init() {
parser.AddCommand("images",
"Visualize docker images.",
"",
&imagesCommand)
}