1 # Read in commands.c and add texinfo commands. See Makefile.am.
7 if ($
0 ~
/!
BEGIN-HELP
-TEXT!
/) {
11 if ($
0 ~
/!
END-HELP
-TEXT!
/) {
14 else if ($
0 ~
/new_command\
(/) {
19 name =
sub(/^
[^
]*/,"&");
20 info =
"@node " $name
", !NEXT!, !PREV!, Commands\n"
21 info = info
"@chapter " $name
" command\n"
22 info = info
"@cindex " $name
" command\n"
23 info = info
"Syntax:\n"
24 info = info
"@example\n"
26 info = info
"@end example\n"
27 list
[list_total
"," "name"] = $name
41 list[list_total "," "info
"] = info
42 list[list_total "," "desc
"] = desc
50 # Borrowed from http://awk.info/?TenLiners
52 function qsort(A, left, right, i, last) {
55 swap(A, left, left+int((right-left+1)*rand()))
57 for (i = left+1; i <= right; i++)
58 if (A[i "," "name
"] < A[left "," "name
"])
61 qsort(A, left, last-1)
62 qsort(A, last+1, right)
65 function swap(A, i, j, hrm) {
66 name = A[i "," "name
"];
67 info = A[i "," "info
"];
68 desc = A[i "," "desc
"];
69 A[i "," "name
"] = A[j "," "name
"]
70 A[i "," "info
"] = A[j "," "info
"]
71 A[i "," "desc
"] = A[j "," "desc
"]
72 A[j "," "name
"] = name;
73 A[j "," "info
"] = info;
74 A[j "," "desc
"] = desc;
78 qsort(list, 1, list_total-1)
80 for (t = 1; t < list_total; t++) {
82 sub(/!PREV!/, "", list[t "," "info
"])
85 sub(/!PREV!/, list[t-1 "," "name
"], list[t "," "info
"])
88 if (t == list_total-1) {
89 sub(/!NEXT!/, "", list[t "," "info
"])
92 sub(/!NEXT!/, list[t+1 "," "name
"], list[t "," "info
"])
95 print list[t "," "info
"] "\n" list[t "," "desc
"]
96 print "* " list[t "," "name
"] "::" > "menu.texi.in
"