| 416 | } |
| 417 | |
| 418 | void list_cmds_by_config(struct string_list *list) |
| 419 | { |
| 420 | const char *cmd_list; |
| 421 | |
| 422 | if (repo_config_get_string_tmp(the_repository, "completion.commands", &cmd_list)) |
| 423 | return; |
| 424 | |
| 425 | string_list_sort_u(list, 1); |
| 426 | |
| 427 | while (*cmd_list) { |
| 428 | struct strbuf sb = STRBUF_INIT; |
| 429 | const char *p = strchrnul(cmd_list, ' '); |
| 430 | |
| 431 | strbuf_add(&sb, cmd_list, p - cmd_list); |
| 432 | if (sb.buf[0] == '-') |
| 433 | string_list_remove(list, sb.buf + 1, 0); |
| 434 | else |
| 435 | string_list_insert(list, sb.buf); |
| 436 | strbuf_release(&sb); |
| 437 | while (*p == ' ') |
| 438 | p++; |
| 439 | cmd_list = p; |
| 440 | } |
| 441 | } |
| 442 | |
| 443 | void list_guides_help(void) |
| 444 | { |
no test coverage detected