Blame


1 870210fb 2021-03-26 op BEGIN {
2 afc1045c 2021-04-30 op FS = "[(,)]";
3 c51c42e4 2021-03-28 op
4 a3666ed5 2021-06-25 op print "#include <telescope.h>"
5 a3666ed5 2021-06-25 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 870210fb 2021-03-26 op s = $2;
11 870210fb 2021-03-26 op sub("^cmd_", "", s);
12 870210fb 2021-03-26 op gsub("_", "-", s);
13 870210fb 2021-03-26 op printf("\t{ \"%s\", %s },\n", s, $2);
14 870210fb 2021-03-26 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 afc1045c 2021-04-30 op printf("\t{ \"%s\", %s },\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 870210fb 2021-03-26 op next;
26 870210fb 2021-03-26 op }
27 870210fb 2021-03-26 op
28 870210fb 2021-03-26 op END {
29 870210fb 2021-03-26 op printf("\t{ NULL, NULL },\n");
30 870210fb 2021-03-26 op print "};";
31 870210fb 2021-03-26 op }