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

Function param_usage

common/json_param.c:262–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262static char *param_usage(const tal_t *ctx,
263 const struct param *params)
264{
265 char *usage = tal_strdup(ctx, "");
266 for (size_t i = 0; i < tal_count(params); i++) {
267 /* Don't print |deprecated part! */
268 int len = strcspn(params[i].name, "|");
269 if (i != 0)
270 tal_append_fmt(&usage, " ");
271 if (is_required(params[i].style))
272 tal_append_fmt(&usage, "%.*s", len, params[i].name);
273 else
274 tal_append_fmt(&usage, "[%.*s]", len, params[i].name);
275 }
276 return usage;
277}
278
279static struct command_result *param_arr(struct command *cmd, const char *buffer,
280 const jsmntok_t tokens[],

Callers 1

param_coreFunction · 0.85

Calls 2

tal_append_fmtFunction · 0.85
is_requiredFunction · 0.85

Tested by

no test coverage detected