fix: Refactor src/command/cmd_defs.c for metrics fix
This commit is contained in:
@@ -2988,19 +2988,19 @@ command_docgen(void)
|
||||
cmds = g_list_insert_sorted(cmds, (gpointer)pcmd, (GCompareFunc)_cmp_command);
|
||||
}
|
||||
|
||||
FILE* toc_fragment = fopen("toc_fragment.html", "w");
|
||||
if (!toc_fragment) {
|
||||
log_error("command_docgen(): unable to open toc_fragment.html for writing: %s", g_strerror(errno));
|
||||
g_list_free(cmds);
|
||||
return;
|
||||
}
|
||||
FILE* main_fragment = fopen("main_fragment.html", "w");
|
||||
if (!main_fragment) {
|
||||
log_error("command_docgen(): unable to open main_fragment.html for writing: %s", g_strerror(errno));
|
||||
fclose(toc_fragment);
|
||||
g_list_free(cmds);
|
||||
return;
|
||||
}
|
||||
FILE* toc_fragment = fopen("toc_fragment.html", "w");
|
||||
if (!toc_fragment) {
|
||||
log_error("command_docgen(): unable to open toc_fragment.html for writing: %s", g_strerror(errno));
|
||||
g_list_free(cmds);
|
||||
return;
|
||||
}
|
||||
FILE* main_fragment = fopen("main_fragment.html", "w");
|
||||
if (!main_fragment) {
|
||||
log_error("command_docgen(): unable to open main_fragment.html for writing: %s", g_strerror(errno));
|
||||
fclose(toc_fragment);
|
||||
g_list_free(cmds);
|
||||
return;
|
||||
}
|
||||
|
||||
fputs("<ul><li><ul><li>\n", toc_fragment);
|
||||
fputs("<hr>\n", main_fragment);
|
||||
@@ -3068,8 +3068,8 @@ command_docgen(void)
|
||||
|
||||
fputs("</ul></ul>\n", toc_fragment);
|
||||
|
||||
fclose(toc_fragment);
|
||||
fclose(main_fragment);
|
||||
fclose(toc_fragment);
|
||||
fclose(main_fragment);
|
||||
printf("\nProcessed %d commands.\n\n", g_list_length(cmds));
|
||||
g_list_free(cmds);
|
||||
}
|
||||
@@ -3104,12 +3104,12 @@ command_mangen(void)
|
||||
log_error("command_mangen(): could not allocate memory");
|
||||
return;
|
||||
}
|
||||
FILE* manpage = fopen(filename, "w");
|
||||
if (!manpage) {
|
||||
log_error("command_mangen(): unable to open %s for writing: %s", filename, g_strerror(errno));
|
||||
curr = g_list_next(curr);
|
||||
continue;
|
||||
}
|
||||
FILE* manpage = fopen(filename, "w");
|
||||
if (!manpage) {
|
||||
log_error("command_mangen(): unable to open %s for writing: %s", filename, g_strerror(errno));
|
||||
curr = g_list_next(curr);
|
||||
continue;
|
||||
}
|
||||
|
||||
fprintf(manpage, "%s\n", header);
|
||||
fputs(".SH NAME\n", manpage);
|
||||
@@ -3144,7 +3144,7 @@ command_mangen(void)
|
||||
}
|
||||
}
|
||||
|
||||
fclose(manpage);
|
||||
fclose(manpage);
|
||||
curr = g_list_next(curr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user