| 134 | } |
| 135 | |
| 136 | bool common_arg::has_value_from_env() const { |
| 137 | if (env != nullptr && !args_neg.empty()) { |
| 138 | // for compatibility, we need to check LLAMA_ARG_NO_ env as well |
| 139 | std::string neg_env = env; |
| 140 | string_replace_all(neg_env, "LLAMA_ARG_", "LLAMA_ARG_NO_"); |
| 141 | if (std::getenv(neg_env.c_str())) { |
| 142 | return true; |
| 143 | } |
| 144 | } |
| 145 | return env != nullptr && std::getenv(env); |
| 146 | } |
| 147 | |
| 148 | static std::vector<std::string> break_str_into_lines(std::string input, size_t max_char_per_line) { |
| 149 | std::vector<std::string> result; |
no test coverage detected