func (f *Flags) newFlagSet(osLookupEnvFunc func(string) (string, bool), portOverride *int) *flag.FlagSet {
	fs := flag.NewFlagSet("selene-bananas", flag.ExitOnError)
	fs.Usage = func() {
		usage(fs) // [lazy evaluation]
	}
	envValue := func(key string) string {
		envValue, ok := osLookupEnvFunc(key)
		if !ok {
			return ""
		}
		return envValue
	}
	envValueInt := func(key string, defaultValue int) int {
		v1 := envValue(key)
		v2, err := strconv.Atoi(v1)
		if err != nil {
			return defaultValue
		}
		return v2
	}
	envPresent := func(key string) bool {
		_, ok := osLookupEnvFunc(key)
		return ok
	}
	fs.StringVar(&f.DatabaseURL, "data-source", envValue(environmentVariableDatabaseURL), "The data source to the PostgreSQL database (connection URI).")
	fs.IntVar(&f.HTTPPort, "http-port", envValueInt(environmentVariableHTTPPort, 0), "The TCP port for server http requests.  All traffic is redirected to the https port.")
	fs.IntVar(&f.HTTPSPort, "https-port", envValueInt(environmentVariableHTTPSPort, 0), "The TCP port for server https requests.")
	fs.IntVar(portOverride, "port", envValueInt(environmentVariablePort, 0), "The single port to run the server on.  Overrides the -https-port flag.  Causes the server to not handle http requests, ignoring -http-port.")
	fs.StringVar(&f.ChallengeToken, "acme-challenge-token", envValue(environmentVariableChallengeToken), "The ACME HTTP-01 Challenge token used to get a certificate.")
	fs.StringVar(&f.ChallengeKey, "acme-challenge-key", envValue(environmentVariableChallengeKey), "The ACME HTTP-01 Challenge key used to get a certificate.")
	fs.BoolVar(&f.DebugGame, "debug-game", envPresent(environmentVariableDebugGame), "Logs message types in the console when messages are passed between components.")
	fs.BoolVar(&f.NoTLSRedirect, "no-tls-redirect", envPresent(environmentVariableNoTLSRedirect), "Disables HTTPS redirection from http if present.")
	fs.IntVar(&f.CacheSec, "cache-sec", envValueInt(environmentVariableCacheSec, defaultCacheSec), "The number of seconds static assets are cached, such as javascript files.")
	return fs
}
// newFlagSet creates a flagSet that populates the flags.
newFlagSet creates a flagSet that populates the flags.
// newFlagSet creates a flagSet that populates the flags .
func (f *Flags) newFlagSet(osLookupEnvFunc func(string) (string, bool), portOverride *int) *flag.FlagSet {
	fs := flag.NewFlagSet("selene-bananas", flag.ExitOnError)
	fs.Usage = func() {
		usage(fs) 
	}
	envValue := func(key string) string {
		envValue, ok := osLookupEnvFunc(key)
		if !ok {
			return ""
		}
		return envValue
	}
	envValueInt := func(key string, defaultValue int) int {
		v1 := envValue(key)
		v2, err := strconv.Atoi(v1)
		if err != nil {
			return defaultValue
		}
		return v2
	}
	envPresent := func(key string) bool {
		_, ok := osLookupEnvFunc(key)
		return ok
	}
	fs.StringVar(&f.DatabaseURL, "data-source", envValue(environmentVariableDatabaseURL), "The data source to the PostgreSQL database (connection URI).")
	fs.IntVar(&f.HTTPPort, "http-port", envValueInt(environmentVariableHTTPPort, 0), "The TCP port for server http requests.  All traffic is redirected to the https port.")
	fs.IntVar(&f.HTTPSPort, "https-port", envValueInt(environmentVariableHTTPSPort, 0), "The TCP port for server https requests.")
	fs.IntVar(portOverride, "port", envValueInt(environmentVariablePort, 0), "The single port to run the server on.  Overrides the -https-port flag.  Causes the server to not handle http requests, ignoring -http-port.")
	fs.StringVar(&f.ChallengeToken, "acme-challenge-token", envValue(environmentVariableChallengeToken), "The ACME HTTP-01 Challenge token used to get a certificate.")
	fs.StringVar(&f.ChallengeKey, "acme-challenge-key", envValue(environmentVariableChallengeKey), "The ACME HTTP-01 Challenge key used to get a certificate.")
	fs.BoolVar(&f.DebugGame, "debug-game", envPresent(environmentVariableDebugGame), "Logs message types in the console when messages are passed between components.")
	fs.BoolVar(&f.NoTLSRedirect, "no-tls-redirect", envPresent(environmentVariableNoTLSRedirect), "Disables HTTPS redirection from http if present.")
	fs.IntVar(&f.CacheSec, "cache-sec", envValueInt(environmentVariableCacheSec, defaultCacheSec), "The number of seconds static assets are cached, such as javascript files.")
	return fs
}
func ( f * Flags ) newFlagSet ( osLookupEnvFunc func ( string ) ( string , bool ) , portOverride * int ) * flag . FlagSet { fs := flag . NewFlagSet ( " " , flag . ExitOnError ) fs . Usage = func ( ) { usage ( fs ) } envValue := func ( key string ) string { envValue , ok := osLookupEnvFunc ( key ) if ! ok { return " " } return envValue } envValueInt := func ( key string , defaultValue int ) int { v1 := envValue ( key ) v2 , err := strconv . Atoi ( v1 ) if err != nil { return defaultValue } return v2 } envPresent := func ( key string ) bool { _ , ok := osLookupEnvFunc ( key ) return ok } fs . StringVar ( & f . DatabaseURL , " " , envValue ( environmentVariableDatabaseURL ) , " " ) fs . IntVar ( & f . HTTPPort , " " , envValueInt ( environmentVariableHTTPPort , 0 ) , " " ) fs . IntVar ( & f . HTTPSPort , " " , envValueInt ( environmentVariableHTTPSPort , 0 ) , " " ) fs . IntVar ( portOverride , " " , envValueInt ( environmentVariablePort , 0 ) , " " ) fs . StringVar ( & f . ChallengeToken , " " , envValue ( environmentVariableChallengeToken ) , " " ) fs . StringVar ( & f . ChallengeKey , " " , envValue ( environmentVariableChallengeKey ) , " " ) fs . BoolVar ( & f . DebugGame , " " , envPresent ( environmentVariableDebugGame ) , " " ) fs . BoolVar ( & f . NoTLSRedirect , " " , envPresent ( environmentVariableNoTLSRedirect ) , " " ) fs . IntVar ( & f . CacheSec , " " , envValueInt ( environmentVariableCacheSec , defaultCacheSec ) , " " ) return fs }
newFlagSet creates a flagSet that populates the flags.
newFlagSet creates a flagSet that populates the flags .
// [lazy evaluation]