Blame


1 870210fb 2021-03-26 op BEGIN {
2 411fb0a2 2021-07-15 op FS = "[(,)]";
3 c51c42e4 2021-03-28 op
4 dffcd78a 2021-07-15 op print "#include \"telescope.h\""
5 dffcd78a 2021-07-15 op print "#include \"cmd.h\""
6 a3666ed5 2021-06-25 op print "struct cmd cmds[] = {";
7 870210fb 2021-03-26 op }
8 870210fb 2021-03-26 op
9 870210fb 2021-03-26 op /^CMD/ {
10 411fb0a2 2021-07-15 op s = $2;
11 411fb0a2 2021-07-15 op sub("^cmd_", "", s);
12 411fb0a2 2021-07-15 op gsub("_", "-", s);
13 b3be07ea 2021-07-18 op printf("\t{ \"%s\", %s, %s },\n", s, $2, $3);
14 411fb0a2 2021-07-15 op next;
15 870210fb 2021-03-26 op }
16 870210fb 2021-03-26 op
17 afc1045c 2021-04-30 op /^DEFALIAS/ {
18 afc1045c 2021-04-30 op s = $2;
19 afc1045c 2021-04-30 op d = $3;
20 b3be07ea 2021-07-18 op printf("\t{ \"%s\", %s, NULL },\n", s, d);
21 afc1045c 2021-04-30 op next
22 afc1045c 2021-04-30 op }
23 afc1045c 2021-04-30 op
24 870210fb 2021-03-26 op {
25 411fb0a2 2021-07-15 op next;
26 870210fb 2021-03-26 op }
27 870210fb 2021-03-26 op
28 870210fb 2021-03-26 op END {
29 b3be07ea 2021-07-18 op printf("\t{ NULL, NULL, NULL },\n");
30 870210fb 2021-03-26 op print "};";
31 870210fb 2021-03-26 op }