| 260 | } |
| 261 | |
| 262 | static 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 | |
| 279 | static struct command_result *param_arr(struct command *cmd, const char *buffer, |
| 280 | const jsmntok_t tokens[], |
no test coverage detected