2015-05-22 18:27:31 +02:00
|
|
|
package main // import "github.com/justone/dockviz"
|
2014-04-21 18:30:55 +02:00
|
|
|
|
|
|
|
import (
|
2015-05-22 07:33:11 +02:00
|
|
|
"fmt"
|
2014-04-21 18:30:55 +02:00
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/jessevdk/go-flags"
|
|
|
|
)
|
|
|
|
|
|
|
|
type GlobalOptions struct {
|
2015-05-21 23:33:45 +02:00
|
|
|
TLSCaCert string `long:"tlscacert" value-name:"~/.docker/ca.pem" description:"Trust certs signed only by this CA"`
|
|
|
|
TLSCert string `long:"tlscert" value-name:"~/.docker/cert.pem" description:"Path to TLS certificate file"`
|
|
|
|
TLSKey string `long:"tlskey" value-name:"~/.docker/key.pem" description:"Path to TLS key file"`
|
|
|
|
TLSVerify bool `long:"tlsverify" description:"Use TLS and verify the remote"`
|
2015-05-21 23:42:53 +02:00
|
|
|
Host string `long:"host" short:"H" value-name:"unix:///var/run/docker.sock" description:"Docker host to connect to"`
|
2015-05-22 07:33:11 +02:00
|
|
|
Version func() `long:"version" short:"v" description:"Display version information."`
|
2016-12-08 21:18:12 +01:00
|
|
|
Stdin bool `long:"stdin" description:"Enable reading image information from stdin (pre-Docker-1.11 only)"`
|
2014-04-21 18:30:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var globalOptions GlobalOptions
|
|
|
|
var parser = flags.NewParser(&globalOptions, flags.Default)
|
|
|
|
|
2016-12-08 21:25:17 +01:00
|
|
|
var version = "v0.5.0"
|
2015-05-22 07:33:11 +02:00
|
|
|
|
2014-04-21 18:30:55 +02:00
|
|
|
func main() {
|
2015-05-22 07:33:11 +02:00
|
|
|
globalOptions.Version = func() {
|
|
|
|
fmt.Println("dockviz", version)
|
|
|
|
os.Exit(0)
|
|
|
|
}
|
2014-04-21 18:30:55 +02:00
|
|
|
if _, err := parser.Parse(); err != nil {
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|