func main()

in cmd/auth/main.go [37:64]


func main() {
	if len(os.Args) < 2 {
		fmt.Println(help)
		return
	}
	switch os.Args[1] {
	case "refresh":
		refreshFlags := flag.NewFlagSet("refresh", flag.ExitOnError)
		var (
			token = refreshFlags.String("token", "", "The oauth token to write to the netrc file. Most users should not set this field and let the tool find the credentials to use from the environment.")
		)
		refreshFlags.Parse(os.Args[2:])
		refresh(*token)
	case "add-locations":
		addLocationFlags := flag.NewFlagSet("add-location", flag.ExitOnError)
		var (
			jsonKey     = addLocationFlags.String("json_key", "", "path to the json key of the service account used for this location. Leave empty to use the oauth token instead.")
			hostPattern = addLocationFlags.String("host_pattern", "%s-go.pkg.dev", "Artifact Registry server host pattern, where %s will be replaced by a location string.")
			locations   = addLocationFlags.String("locations", "", "Required. A list of comma-separated location strings to regional Artifact Registry Go endpoints to the netrc file.")
		)
		addLocationFlags.Parse(os.Args[2:])
		addLocations(*locations, *jsonKey, *hostPattern)
	case "help", "-help", "--help":
		fmt.Println(help)
	default:
		fmt.Printf("unknown command %q. Please rerun the tool with `--help`\n", os.Args[1])
	}
}