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.

17 lines
394B

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