| 186 | } |
| 187 | |
| 188 | static void parse_configvars(struct configvar **cvs, |
| 189 | bool early, |
| 190 | bool full_knowledge, |
| 191 | bool developer) |
| 192 | { |
| 193 | for (size_t i = 0; i < tal_count(cvs); i++) { |
| 194 | const char *problem, *line; |
| 195 | const struct opt_table *ot; |
| 196 | bool should_know; |
| 197 | |
| 198 | should_know = full_knowledge; |
| 199 | /* We should always know cmdline args in final parse */ |
| 200 | if (!early && cvs[i]->src == CONFIGVAR_CMDLINE) |
| 201 | should_know = true; |
| 202 | |
| 203 | current_cv = cvs[i]; |
| 204 | problem = configvar_parse(cvs[i], |
| 205 | early, |
| 206 | should_know, |
| 207 | developer); |
| 208 | current_cv = NULL; |
| 209 | if (!problem) |
| 210 | continue; |
| 211 | |
| 212 | /* Don't print secrets */ |
| 213 | ot = configvar_unparsed(cvs[i]); |
| 214 | if (ot && (ot->type & OPT_CONCEAL) && cvs[i]->optarg) |
| 215 | line = tal_fmt(tmpctx, "%s=...", cvs[i]->optvar); |
| 216 | else |
| 217 | line = cvs[i]->configline; |
| 218 | |
| 219 | if (cvs[i]->file) { |
| 220 | errx(opt_exitcode, "Config file %s line %u: %s: %s", |
| 221 | cvs[i]->file, cvs[i]->linenum, line, problem); |
| 222 | } else { |
| 223 | errx(opt_exitcode, "--%s: %s", line, problem); |
| 224 | } |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | static void finished_arg(int *argc, char **argv, size_t *idx, |
| 229 | bool remove_args) |
no test coverage detected