diff options
Diffstat (limited to 'wu-user/bin')
-rwxr-xr-x | wu-user/bin/rm-killed-mail | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/wu-user/bin/rm-killed-mail b/wu-user/bin/rm-killed-mail new file mode 100755 index 0000000..b8c7ae8 --- /dev/null +++ b/wu-user/bin/rm-killed-mail @@ -0,0 +1,21 @@ +#! /bin/sh +set -euf + +if ! notmuch search tag:killed | grep -q . ; then + echo 'no killed mail; abort.' + exit 1 +fi + +notmuch search tag:killed +printf 'want do rm these mail? [y/N] ' +read REPLY +case "$REPLY" in + y|Y) :;; # continue + *) + echo 'abort.' + exit 2 + ;; +esac + +notmuch search --output=files tag:killed | xargs -l rm -v +notmuch new |