]> Sergey Matveev's repositories - zk.zsh.git/commitdiff
Ability to show missing links
authorSergey Matveev <stargrave@stargrave.org>
Sun, 13 Mar 2022 11:58:29 +0000 (14:58 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 13 Mar 2022 11:58:29 +0000 (14:58 +0300)
zk.zsh

diff --git a/zk.zsh b/zk.zsh
index 253c5029a33edca6f0e21d353cf50c89444f5033..d478ed037baf9b28624f938f06c0e6417a146ee5 100755 (executable)
--- a/zk.zsh
+++ b/zk.zsh
@@ -33,7 +33,10 @@ for p (${(k)pages}) {
     for w (`< $p`) {
         [[ $w =~ "\[(.*)\]" ]] || continue
         w=${match[1]}
-        [[ ${pages[$w]} ]] || continue
+        [[ ${pages[$w]} ]] || {
+            [[ $ZK_SHOW_MISSING ]] && print "Missing $w"
+            continue
+        }
         links[$p]="$w ${links[$p]}"
     }
 }