Testing ground for GUI
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

16 lines
394 B

#!/bin/sh
LC_ALL=C exec awk '
/^[0-9]+ *(ERR|RPL)_[A-Z]+ *".*"$/ {
match($0, /".*"/);
ids[$1] = $2;
texts[$2] = substr($0, RSTART, RLENGTH);
}
END {
print "package " ENVIRON["GOPACKAGE"] "\n\nconst ("
for (i in ids)
printf("\t%s = %s\n", ids[i], i)
print ")\n\nvar defaultReplies = map[int]string{"
for (i in ids)
print "\t" ids[i] ": " texts[ids[i]] ","
print "}"
}'