aboutsummaryrefslogtreecommitdiff
path: root/xD-gen-replies.sh
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-08-29 06:02:54 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-08-29 06:07:49 +0200
commitecebeace0ea28f243045bdee1002530028846fe8 (patch)
tree20b4408449d312ae55eff3ecc2afd4b222dc84ae /xD-gen-replies.sh
parentca33adeeeee56262b95a6ff1339227bfc90e0a82 (diff)
downloadxK-ecebeace0ea28f243045bdee1002530028846fe8.tar.gz
xK-ecebeace0ea28f243045bdee1002530028846fe8.tar.xz
xK-ecebeace0ea28f243045bdee1002530028846fe8.zip
Don't wrap xD-gen-replies in a shell script
AWK doesn't seem to be that friendly to shebangs, so let env, also required for changing LC_ALL, locate it in PATH.
Diffstat (limited to 'xD-gen-replies.sh')
-rwxr-xr-xxD-gen-replies.sh28
1 files changed, 0 insertions, 28 deletions
diff --git a/xD-gen-replies.sh b/xD-gen-replies.sh
deleted file mode 100755
index 0fcbbba..0000000
--- a/xD-gen-replies.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-LC_ALL=C exec awk '
- BEGIN {
- # The message catalog is a by-product
- msg = "xD.msg"
- print "$quote \"" > msg;
- print "$set 1" > msg;
- }
- /^[0-9]+ *IRC_(ERR|RPL)_[A-Z]+ *".*"$/ {
- match($0, /".*"/);
- ids[$1] = $2;
- texts[$2] = substr($0, RSTART, RLENGTH);
- print $1 " " texts[$2] > msg
- }
- END {
- printf("enum\n{")
- for (i in ids) {
- if (seen_first)
- printf(",")
- seen_first = 1
- printf("\n\t%s = %s", ids[i], i)
- }
- print "\n};\n"
- print "static const char *g_default_replies[] =\n{"
- for (i in ids)
- print "\t[" ids[i] "] = " texts[ids[i]] ","
- print "};"
- }'