initial skeleton
This commit is contained in:
parent
b71347fbb6
commit
9155320da8
3 changed files with 50 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -21,3 +21,5 @@ _testmain.go
|
|||
|
||||
*.exe
|
||||
*.test
|
||||
|
||||
dockviz*
|
||||
|
|
20
cli.go
Normal file
20
cli.go
Normal 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
28
images.go
Normal 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)
|
||||
}
|
Loading…
Reference in a new issue