From 0d6e4e016d1428f7c849a3d1aa4869bb8ce46622 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Tue, 7 Nov 2023 09:27:50 +0100 Subject: [PATCH] match whole words in commands If e.g. you have a AUTO_NOTIFY_WHITELIST=d, notify on "d" but not on "diff". --- auto-notify.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto-notify.plugin.zsh b/auto-notify.plugin.zsh index b908913..8981e34 100644 --- a/auto-notify.plugin.zsh +++ b/auto-notify.plugin.zsh @@ -89,7 +89,7 @@ function _is_auto_notify_ignored() { if [[ -n "$AUTO_NOTIFY_WHITELIST" ]]; then for allowed in $AUTO_NOTIFY_WHITELIST; do - if [[ "$target_command" == "$allowed"* ]]; then + if [[ "$target_command" == "$allowed"(| *) ]]; then print "no" return fi @@ -97,7 +97,7 @@ function _is_auto_notify_ignored() { print "yes" else for ignore in $AUTO_NOTIFY_IGNORE; do - if [[ "$target_command" == "$ignore"* ]]; then + if [[ "$target_command" == "$ignore"*(| *) ]]; then print "yes" return fi