From 19fb907bc5f44485b437b26a678900c8a2a665cc Mon Sep 17 00:00:00 2001
From: James Booth Usage:%s
\n", pcmd->cmd);
- fputs("%s
Usage:
\n", main_fragment); +// fprintf(main_fragment, "%s
\n", pcmd->help.usage);
+//
+// fputs("Details:
\n", main_fragment); +// fputs("", main_fragment);
+// int i = 2;
+// while (pcmd->help.long_help[i]) {
+// fprintf(main_fragment, "%s\n", pcmd->help.long_help[i++]);
+// }
+// fputs("
\nDetails:
\n", main_fragment); - fputs("", main_fragment);
- int i = 2;
- while (pcmd->help.long_help[i]) {
- fprintf(main_fragment, "%s\n", pcmd->help.long_help[i++]);
+ // new style
+ } else {
+ fprintf(toc_fragment, "%s,\n", &pcmd->cmd[1], pcmd->cmd);
+ fprintf(main_fragment, "\n", &pcmd->cmd[1]);
+ fprintf(main_fragment, "%s
\n", pcmd->cmd);
+
+ fputs("Synopsis
\n", main_fragment);
+ fputs("", main_fragment);
+ int i = 0;
+ while (pcmd->help.synopsis[i]) {
+ char *str1 = str_replace(pcmd->help.synopsis[i], "<", "<");
+ char *str2 = str_replace(str1, ">", ">");
+ fprintf(main_fragment, "%s\n", str2);
+ i++;
+ }
+ fputs("
\n", main_fragment);
+
+ fputs("Description
\n", main_fragment);
+ fputs("", main_fragment);
+ fprintf(main_fragment, "%s\n", pcmd->help.desc);
+ fputs("
\n", main_fragment);
+
+ if (pcmd->help.args[0][0] != NULL) {
+ fputs("Arguments
\n", main_fragment);
+ fputs("", main_fragment);
+ for (i = 0; pcmd->help.args[i][0] != NULL; i++) {
+ fputs("", main_fragment);
+ fputs("", main_fragment);
+ fputs("", main_fragment);
+ char *str1 = str_replace(pcmd->help.args[i][0], "<", "<");
+ char *str2 = str_replace(str1, ">", ">");
+ fprintf(main_fragment, "%s", str2);
+ fputs("
", main_fragment);
+ fputs(" ", main_fragment);
+ fputs("", main_fragment);
+ fprintf(main_fragment, "%s", pcmd->help.args[i][1]);
+ fputs(" ", main_fragment);
+ fputs(" ", main_fragment);
+ }
+ fputs("
\n", main_fragment);
+ }
+
+ if (pcmd->help.examples[0] != NULL) {
+ fputs("Examples
\n", main_fragment);
+ fputs("", main_fragment);
+ int i = 0;
+ while (pcmd->help.examples[i]) {
+ fprintf(main_fragment, "%s\n", pcmd->help.examples[i]);
+ i++;
+ }
+ fputs("
\n", main_fragment);
+ }
+
+ fputs("back to top
\n", main_fragment);
+ fputs("\n", main_fragment);
}
- fputs("
\n