Line | Count | Source (jump to first uncovered line) |
1 | | #ifndef HELP_H |
2 | | #define HELP_H |
3 | | |
4 | | #include "string-list.h" |
5 | | #include "strbuf.h" |
6 | | |
7 | | struct cmdnames { |
8 | | int alloc; |
9 | | int cnt; |
10 | | struct cmdname { |
11 | | size_t len; /* also used for similarity index in help.c */ |
12 | | char name[FLEX_ARRAY]; |
13 | | } **names; |
14 | | }; |
15 | | |
16 | | void cmdnames_release(struct cmdnames *cmds); |
17 | | |
18 | | static inline void mput_char(char c, unsigned int num) |
19 | 0 | { |
20 | 0 | while (num--) |
21 | 0 | putchar(c); |
22 | 0 | } Unexecuted instantiation: branch.c:mput_char Unexecuted instantiation: bugreport.c:mput_char Unexecuted instantiation: clean.c:mput_char Unexecuted instantiation: commit.c:mput_char Unexecuted instantiation: help.c:mput_char Unexecuted instantiation: merge-tree.c:mput_char Unexecuted instantiation: merge.c:mput_char Unexecuted instantiation: git.c:mput_char Unexecuted instantiation: advice.c:mput_char Unexecuted instantiation: diagnose.c:mput_char Unexecuted instantiation: diff.c:mput_char Unexecuted instantiation: fsck.c:mput_char Unexecuted instantiation: grep.c:mput_char Unexecuted instantiation: log-tree.c:mput_char Unexecuted instantiation: sideband.c:mput_char |
23 | | |
24 | | void list_common_cmds_help(void); |
25 | | void list_all_cmds_help(int show_external_commands, int show_aliases); |
26 | | void list_guides_help(void); |
27 | | void list_user_interfaces_help(void); |
28 | | void list_developer_interfaces_help(void); |
29 | | |
30 | | void list_all_main_cmds(struct string_list *list); |
31 | | void list_all_other_cmds(struct string_list *list); |
32 | | void list_cmds_by_category(struct string_list *list, |
33 | | const char *category); |
34 | | void list_cmds_by_config(struct string_list *list); |
35 | | const char *help_unknown_cmd(const char *cmd); |
36 | | void load_command_list(const char *prefix, |
37 | | struct cmdnames *main_cmds, |
38 | | struct cmdnames *other_cmds); |
39 | | void load_builtin_commands(const char *prefix, struct cmdnames *cmds); |
40 | | void add_cmdname(struct cmdnames *cmds, const char *name, int len); |
41 | | /* Here we require that excludes is a sorted list. */ |
42 | | void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes); |
43 | | int is_in_cmdlist(struct cmdnames *cmds, const char *name); |
44 | | void list_commands(struct cmdnames *main_cmds, struct cmdnames *other_cmds); |
45 | | void get_version_info(struct strbuf *buf, int show_build_options); |
46 | | |
47 | | /* |
48 | | * call this to die(), when it is suspected that the user mistyped a |
49 | | * ref to the command, to give suggested "correct" refs. |
50 | | */ |
51 | | NORETURN void help_unknown_ref(const char *ref, const char *cmd, const char *error); |
52 | | |
53 | | static inline void list_config_item(struct string_list *list, |
54 | | const char *prefix, |
55 | | const char *str) |
56 | 0 | { |
57 | 0 | string_list_append_nodup(list, xstrfmt("%s.%s", prefix, str)); |
58 | 0 | } Unexecuted instantiation: branch.c:list_config_item Unexecuted instantiation: bugreport.c:list_config_item Unexecuted instantiation: clean.c:list_config_item Unexecuted instantiation: commit.c:list_config_item Unexecuted instantiation: help.c:list_config_item Unexecuted instantiation: merge-tree.c:list_config_item Unexecuted instantiation: merge.c:list_config_item Unexecuted instantiation: git.c:list_config_item Unexecuted instantiation: advice.c:list_config_item Unexecuted instantiation: diagnose.c:list_config_item Unexecuted instantiation: diff.c:list_config_item Unexecuted instantiation: fsck.c:list_config_item Unexecuted instantiation: grep.c:list_config_item Unexecuted instantiation: log-tree.c:list_config_item Unexecuted instantiation: sideband.c:list_config_item |
59 | | |
60 | | #define define_list_config_array(array) \ |
61 | 0 | void list_config_##array(struct string_list *list, const char *prefix) \ |
62 | 0 | { \ |
63 | 0 | int i; \ |
64 | 0 | for (i = 0; i < ARRAY_SIZE(array); i++) \ |
65 | 0 | if (array[i]) \ |
66 | 0 | list_config_item(list, prefix, array[i]); \ |
67 | 0 | } \ Unexecuted instantiation: list_config_color_branch_slots Unexecuted instantiation: list_config_color_interactive_slots Unexecuted instantiation: list_config_color_decorate_slots |
68 | | struct string_list |
69 | | |
70 | | #define define_list_config_array_extra(array, values) \ |
71 | 0 | void list_config_##array(struct string_list *list, const char *prefix) \ |
72 | 0 | { \ |
73 | 0 | int i; \ |
74 | 0 | static const char *extra[] = values; \ |
75 | 0 | for (i = 0; i < ARRAY_SIZE(extra); i++) \ |
76 | 0 | list_config_item(list, prefix, extra[i]); \ |
77 | 0 | for (i = 0; i < ARRAY_SIZE(array); i++) \ |
78 | 0 | if (array[i]) \ |
79 | 0 | list_config_item(list, prefix, array[i]); \ |
80 | 0 | } \ Unexecuted instantiation: list_config_color_status_slots Unexecuted instantiation: list_config_color_diff_slots Unexecuted instantiation: list_config_color_grep_slots |
81 | | struct string_list |
82 | | |
83 | | /* These are actually scattered over many C files */ |
84 | | void list_config_advices(struct string_list *list, const char *prefix); |
85 | | void list_config_color_branch_slots(struct string_list *list, const char *prefix); |
86 | | void list_config_color_decorate_slots(struct string_list *list, const char *prefix); |
87 | | void list_config_color_diff_slots(struct string_list *list, const char *prefix); |
88 | | void list_config_color_grep_slots(struct string_list *list, const char *prefix); |
89 | | void list_config_color_interactive_slots(struct string_list *list, const char *prefix); |
90 | | void list_config_color_status_slots(struct string_list *list, const char *prefix); |
91 | | void list_config_color_sideband_slots(struct string_list *list, const char *prefix); |
92 | | void list_config_fsck_msg_ids(struct string_list *list, const char *prefix); |
93 | | |
94 | | #endif /* HELP_H */ |