Reads and returns the Boolean environment variable corresponding to the given flag; if it's not set, returns default_value. The value is considered true iff it's not "0".
| 93 | // |
| 94 | // The value is considered true iff it's not "0". |
| 95 | bool BoolFromEnv(const char* flag, bool default_value) { |
| 96 | const std::string env_var = FlagToEnvVar(flag); |
| 97 | const char* const string_value = getenv(env_var.c_str()); |
| 98 | return string_value == nullptr ? default_value |
| 99 | : strcmp(string_value, "0") != 0; |
| 100 | } |
| 101 | |
| 102 | // Reads and returns a 32-bit integer stored in the environment |
| 103 | // variable corresponding to the given flag; if it isn't set or |
nothing calls this directly
no test coverage detected