Extend debug info
authorSiraaj Khandkar <siraaj@khandkar.net>
Mon, 14 Feb 2022 14:09:14 +0000 (09:09 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Mon, 14 Feb 2022 14:09:14 +0000 (09:09 -0500)
home/lib/login_functions.sh

index 0ff4e86..d5bd5dd 100644 (file)
@@ -8,6 +8,7 @@ p() {
            BEGIN {_s = tolower(_s)}
 
            /^[a-zA-Z]/ && tolower($1) ~ _s && NF >= 2 {
+               n++
                s = $1
                p = $NF
                if (NF == 2) {
@@ -20,7 +21,15 @@ p() {
                    e = $2
                    u = $3
                } # TODO What would NF > 4 mean?
-               printf("s:\"%s\", e:\"%s\", u:\"%s\"\n", s, e, u) > "/dev/stderr"
+
+                printf("%d [O] s:\"%s\", e:\"%s\", u:\"%s\"\n", n, s, e, u) > "/dev/stderr"
+                if (match(u, "@")) {
+                    tmp = e
+                    e = u
+                    u = tmp
+                    printf("%d [C] s:\"%s\", e:\"%s\", u:\"%s\"\n", n, s, e, u) > "/dev/stderr"
+                }
+
                printf "%s", p # XXX Intentionally avoiding newline in the result.
            }
        ' \
This page took 0.026028 seconds and 4 git commands to generate.