diff options
Diffstat (limited to 'applets')
-rw-r--r-- | applets/usage_pod.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/applets/usage_pod.c b/applets/usage_pod.c index 9e6d3f0ee..2c177be90 100644 --- a/applets/usage_pod.c +++ b/applets/usage_pod.c | |||
@@ -67,30 +67,37 @@ int main(void) | |||
67 | } | 67 | } |
68 | if (col == 0) { | 68 | if (col == 0) { |
69 | col = 6; | 69 | col = 6; |
70 | printf("\t"); | ||
71 | } else { | 70 | } else { |
72 | printf(", "); | 71 | printf(", "); |
73 | } | 72 | } |
74 | printf("%s", usage_array[i].aname); | 73 | if (usage_array[i].usage[0] != NOUSAGE_STR[0]) { |
74 | /* | ||
75 | * If the applet usage string will be included in the final document | ||
76 | * optimistically link to its header (which is just the applet name). | ||
77 | */ | ||
78 | printf("L<C<%1$s>|/\"%1$s\">", usage_array[i].aname); | ||
79 | } else { | ||
80 | /* Without a usage string, just output the applet name with no link. */ | ||
81 | printf("C<%s>", usage_array[i].aname); | ||
82 | } | ||
75 | col += len2; | 83 | col += len2; |
76 | } | 84 | } |
77 | printf("\n\n"); | 85 | printf("\n\n"); |
78 | 86 | ||
79 | printf("=head1 COMMAND DESCRIPTIONS\n\n"); | 87 | printf("=head1 COMMAND DESCRIPTIONS\n\n"); |
80 | printf("=over 4\n\n"); | ||
81 | 88 | ||
82 | for (i = 0; i < num_messages; i++) { | 89 | for (i = 0; i < num_messages; i++) { |
83 | if (usage_array[i].aname[0] >= 'a' && usage_array[i].aname[0] <= 'z' | 90 | if (usage_array[i].aname[0] >= 'a' && usage_array[i].aname[0] <= 'z' |
84 | && usage_array[i].usage[0] != NOUSAGE_STR[0] | 91 | && usage_array[i].usage[0] != NOUSAGE_STR[0] |
85 | ) { | 92 | ) { |
86 | printf("=item B<%s>\n\n", usage_array[i].aname); | 93 | /* This is the heading that will be linked from the command list. */ |
94 | printf("=head2 %s\n\n", usage_array[i].aname); | ||
87 | if (usage_array[i].usage[0]) | 95 | if (usage_array[i].usage[0]) |
88 | printf("%s %s\n\n", usage_array[i].aname, usage_array[i].usage); | 96 | printf("%s %s\n\n", usage_array[i].aname, usage_array[i].usage); |
89 | else | 97 | else |
90 | printf("%s\n\n", usage_array[i].aname); | 98 | printf("%s\n\n", usage_array[i].aname); |
91 | } | 99 | } |
92 | } | 100 | } |
93 | printf("=back\n\n"); | ||
94 | 101 | ||
95 | return 0; | 102 | return 0; |
96 | } | 103 | } |