Skip to content

Commit

Permalink
Add flag version
Browse files Browse the repository at this point in the history
  • Loading branch information
caiweidong committed Feb 27, 2019
1 parent c44a77d commit 6584b2a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cmd/hostpathplugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,21 @@ func init() {
}

var (
endpoint = flag.String("endpoint", "unix://tmp/csi.sock", "CSI endpoint")
driverName = flag.String("drivername", "csi-hostpath", "name of the driver")
nodeID = flag.String("nodeid", "", "node id")
endpoint = flag.String("endpoint", "unix://tmp/csi.sock", "CSI endpoint")
driverName = flag.String("drivername", "csi-hostpath", "name of the driver")
nodeID = flag.String("nodeid", "", "node id")
showVersion = flag.Bool("version", false, "Show version.")
version = ""
)

func main() {
flag.Parse()

if *showVersion {
fmt.Println(os.Args[0], version)
return
}

handle()
os.Exit(0)
}
Expand Down

0 comments on commit 6584b2a

Please sign in to comment.