| 240 | } |
| 241 | |
| 242 | static const char **opt_names_arr(const tal_t *ctx, |
| 243 | const struct opt_table *ot) |
| 244 | { |
| 245 | const char **names = tal_arr(ctx, const char *, 0); |
| 246 | const char *name; |
| 247 | unsigned len; |
| 248 | |
| 249 | for (name = first_name(ot->names, &len); |
| 250 | name; |
| 251 | name = next_name(name, &len)) { |
| 252 | /* Skips over first -, so just need to look for one */ |
| 253 | if (name[0] != '-') |
| 254 | continue; |
| 255 | tal_arr_expand(&names, |
| 256 | tal_strndup(names, name+1, len-1)); |
| 257 | } |
| 258 | return names; |
| 259 | } |
| 260 | |
| 261 | static struct command_result *json_listconfigs(struct command *cmd, |
| 262 | const char *buffer, |
no test coverage detected