package main

import (
	"context"
	"flag"
	"os"

	"github.com/google/subcommands"
)

var serverAddress = flag.String("address", os.Getenv("GODGE_ADDR"), "The address of the server")

func main() {
	subcommands.ImportantFlag("address")
	subcommands.Register(subcommands.FlagsCommand(), "")
	subcommands.Register(subcommands.CommandsCommand(), "")
	subcommands.Register(&submitCmd{}, "")
	subcommands.Register(&registerCmd{}, "")
	subcommands.Register(&tasksCmd{}, "")
	flag.Parse()

	ctx := context.Background()
	os.Exit(int(subcommands.Execute(ctx)))
}

package main

import (
	"context"
	"flag"
	"os"

	"github.com/google/subcommands"
)

var serverAddress = flag.String("address", "", "The address of the server")

func main() {
	subcommands.ImportantFlag("address")
	subcommands.Register(subcommands.FlagsCommand(), "")
	subcommands.Register(subcommands.CommandsCommand(), "")
	subcommands.Register(&submitCmd{}, "")
	subcommands.Register(&registerCmd{}, "")
	subcommands.Register(&tasksCmd{}, "")
	flag.Parse()

	ctx := context.Background()
	os.Exit(int(subcommands.Execute(ctx)))
}

--- 
+++ 
@@ -8,7 +8,7 @@
 	"github.com/google/subcommands"
 )
 
-var serverAddress = flag.String("address", "", "The address of the server")
+var serverAddress = flag.String("address", os.Getenv("GODGE_ADDR"), "The address of the server")
 
 func main() {
 	subcommands.ImportantFlag("address")
Allow to define Godge server URL using the GODGE_URL env var
