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)))
}

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)))
}

Allow to define Godge server URL using the GODGE_URL env var
Allow to define Godge server URL using the GODGE_URL env var
