Blob


1 BEGIN {
2 FS = "[()]";
4 print "static struct cmds { const char *cmd; void(*fn)(struct window*); } cmds[] = {";
5 }
7 /^CMD/ {
8 s = $2;
9 sub("^cmd_", "", s);
10 gsub("_", "-", s);
11 printf("\t{ \"%s\", %s },\n", s, $2);
12 next;
13 }
15 {
16 next;
17 }
19 END {
20 printf("\t{ NULL, NULL },\n");
21 print "};";
22 }