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

Function param_usage

common/json_param.c:259–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

paramFunction · 0.85

Calls 2

tal_append_fmtFunction · 0.85
is_requiredFunction · 0.85

Tested by

no test coverage detected