MCPcopy Create free account
hub / github.com/ElementsProject/lightning / parse_configvars

Function parse_configvars

common/configdir.c:188–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188static 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
228static void finished_arg(int *argc, char **argv, size_t *idx,
229 bool remove_args)

Callers 3

initial_config_optsFunction · 0.85
parse_configvars_earlyFunction · 0.85
parse_configvars_finalFunction · 0.85

Calls 3

configvar_parseFunction · 0.85
configvar_unparsedFunction · 0.85
errxFunction · 0.85

Tested by

no test coverage detected