|
28 | 28 | #include <string.h>
|
29 | 29 | #include <getopt.h>
|
30 | 30 | #include <errno.h>
|
| 31 | +#include <ctype.h> |
31 | 32 | #include <libxml/tree.h>
|
32 | 33 | #include <qb/qblist.h>
|
33 | 34 | #include <qb/qbmap.h>
|
@@ -405,6 +406,17 @@ static int read_structure_from_xml(const char *refid, const char *name)
|
405 | 406 | return ret;
|
406 | 407 | }
|
407 | 408 |
|
| 409 | +static char *allcaps(const char *name) |
| 410 | +{ |
| 411 | + static char buffer[1024] = {'\0'}; |
| 412 | + int i; |
| 413 | + |
| 414 | + for (i=0; i< strlen(name); i++) { |
| 415 | + buffer[i] = toupper(name[i]); |
| 416 | + } |
| 417 | + buffer[strlen(name)] = '\0'; |
| 418 | + return buffer; |
| 419 | +} |
408 | 420 |
|
409 | 421 | static void print_param(FILE *manfile, struct param_info *pi, int field_width, int bold, const char *delimiter)
|
410 | 422 | {
|
@@ -635,7 +647,7 @@ static void print_manpage(char *name, char *def, char *brief, char *args, char *
|
635 | 647 | /* Off we go */
|
636 | 648 |
|
637 | 649 | fprintf(manfile, ".\\\" Automatically generated man page, do not edit\n");
|
638 |
| - fprintf(manfile, ".TH %s %s %s \"%s\" \"%s\"\n", name, man_section, dateptr, package_name, header); |
| 650 | + fprintf(manfile, ".TH %s %s %s \"%s\" \"%s\"\n", allcaps(name), man_section, dateptr, package_name, header); |
639 | 651 |
|
640 | 652 | fprintf(manfile, ".SH NAME\n");
|
641 | 653 | if (brief) {
|
@@ -712,20 +724,22 @@ static void print_manpage(char *name, char *def, char *brief, char *args, char *
|
712 | 724 | if (returntext) {
|
713 | 725 | fprintf(manfile, ".SH RETURN VALUE\n");
|
714 | 726 | man_print_long_string(manfile, returntext);
|
715 |
| - } |
716 |
| - if (notetext) { |
717 |
| - fprintf(manfile, ".SH NOTE\n"); |
718 |
| - man_print_long_string(manfile, notetext); |
| 727 | + fprintf(manfile, ".PP\n"); |
719 | 728 | }
|
720 | 729 |
|
721 | 730 | qb_list_for_each(iter, &retval_list) {
|
722 | 731 | pi = qb_list_entry(iter, struct param_info, list);
|
723 | 732 |
|
724 |
| - fprintf(manfile, "\\fB%-*s \\fP\\fI%s\\fP\n", 10, pi->paramname, |
| 733 | + fprintf(manfile, "\\fB%-*s \\fP%s\n", 10, pi->paramname, |
725 | 734 | pi->paramdesc);
|
726 | 735 | fprintf(manfile, ".PP\n");
|
727 | 736 | }
|
728 | 737 |
|
| 738 | + if (notetext) { |
| 739 | + fprintf(manfile, ".SH NOTE\n"); |
| 740 | + man_print_long_string(manfile, notetext); |
| 741 | + } |
| 742 | + |
729 | 743 | fprintf(manfile, ".SH SEE ALSO\n");
|
730 | 744 | fprintf(manfile, ".PP\n");
|
731 | 745 | fprintf(manfile, ".nh\n");
|
|
0 commit comments