Browse Source

:art: Define env vars for dhcp/api

Ettore Di Giacinto 3 years ago
parent
commit
bc7fe7d2cb
1 changed files with 14 additions and 10 deletions
  1. 14 10
      cmd/main.go

+ 14 - 10
cmd/main.go

@@ -56,22 +56,26 @@ func MainFlags() []cli.Flag {
 			Usage: "Encodes the new config in base64, so it can be used as a token",
 		},
 		&cli.BoolFlag{
-			Name:  "api",
-			Usage: "Starts also the API daemon locally for inspecting the network status",
+			Name:   "api",
+			Usage:  "Starts also the API daemon locally for inspecting the network status",
+			EnvVar: "API",
 		},
 		&cli.StringFlag{
-			Name:  "api-listen",
-			Value: ":8080",
-			Usage: "API listening port",
+			Name:   "api-listen",
+			Value:  ":8080",
+			Usage:  "API listening port",
+			EnvVar: "APILISTEN",
 		},
 		&cli.BoolFlag{
-			Name:  "dhcp",
-			Usage: "Enables p2p ip negotiation (experimental)",
+			Name:   "dhcp",
+			Usage:  "Enables p2p ip negotiation (experimental)",
+			EnvVar: "DHCP",
 		},
 		&cli.StringFlag{
-			Name:  "lease-dir",
-			Value: filepath.Join(basedir, ".edgevpn", "leases"),
-			Usage: "DHCP leases directory",
+			Name:   "lease-dir",
+			Value:  filepath.Join(basedir, ".edgevpn", "leases"),
+			Usage:  "DHCP leases directory",
+			EnvVar: "DHCPLEASEDIR",
 		},
 		&cli.StringFlag{
 			Name:   "address",