package main import ( "context" "flag" "os" "path/filepath" "github.com/google/subcommands" ) var ( apiServer = flag.String("api-server", "http://wasmcloud.kahless.cetacean.club:3002", "default API server") configLocation = flag.String("config", filepath.Join(os.Getenv("HOME"), ".wasmc.json"), "default config location") ) func main() { subcommands.Register(subcommands.HelpCommand(), "") subcommands.Register(subcommands.FlagsCommand(), "") subcommands.Register(subcommands.CommandsCommand(), "") subcommands.Register(&loginCmd{}, "") subcommands.Register(&whoamiCmd{}, "") subcommands.Register(namegenCmd{}, "util") subcommands.Register(&testWorkCommand{}, "util") subcommands.ImportantFlag("api-server") subcommands.ImportantFlag("config") flag.Parse() ctx := context.Background() os.Exit(int(subcommands.Execute(ctx))) }