From 3c0485dd7187f09e8cd08d005ed29bbaa6991cb5 Mon Sep 17 00:00:00 2001 From: Shaya Potter Date: Thu, 15 Sep 2016 15:55:39 -0700 Subject: [PATCH] make socket location configurable on cmd line --- cmd/client/main.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd/client/main.go b/cmd/client/main.go index fcf3e3b1..a17f89cd 100644 --- a/cmd/client/main.go +++ b/cmd/client/main.go @@ -14,8 +14,11 @@ import ( "google.golang.org/grpc" ) +var ( + unixDomainSocket string +) + const ( - unixDomainSocket = "/var/run/ocid.sock" // TODO: Make configurable timeout = 10 * time.Second ) @@ -233,6 +236,15 @@ func main() { pullImageCommand, } + app.Flags = []cli.Flag{ + cli.StringFlag{ + Name: "sock", + Value: "/var/run/ocid.sock", + Usage: "Socket to connect to", + Destination: &unixDomainSocket, + }, + } + if err := app.Run(os.Args); err != nil { log.Fatal(err) }