MCPcopy Index your code
hub / github.com/git/git / extract_cmds

Function extract_cmds

help.c:80–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80static void extract_cmds(struct cmdname_help **p_cmds, uint32_t mask)
81{
82 int i, nr = 0;
83 struct cmdname_help *cmds;
84
85 if (ARRAY_SIZE(command_list) == 0)
86 BUG("empty command_list[] is a sign of broken generate-cmdlist.sh");
87
88 ALLOC_ARRAY(cmds, ARRAY_SIZE(command_list) + 1);
89
90 for (i = 0; i < ARRAY_SIZE(command_list); i++) {
91 const struct cmdname_help *cmd = command_list + i;
92
93 if (!(cmd->category & mask))
94 continue;
95
96 cmds[nr] = *cmd;
97 cmds[nr].name = drop_prefix(cmd->name, cmd->category);
98
99 nr++;
100 }
101 cmds[nr].name = NULL;
102 *p_cmds = cmds;
103}
104
105static void print_command_list(const struct cmdname_help *cmds,
106 uint32_t mask, int longest)

Callers 2

print_cmd_by_categoryFunction · 0.85
help_unknown_cmdFunction · 0.85

Calls 1

drop_prefixFunction · 0.85

Tested by

no test coverage detected