From 333402a9f24c2be07b7617afd15f3bc123ee2c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sun, 7 Apr 2024 18:31:19 +0200 Subject: [PATCH] enhance checkShrinker --- src/bash/checkShrinker.sh | 40 ++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/src/bash/checkShrinker.sh b/src/bash/checkShrinker.sh index 8ee010e..cf94906 100755 --- a/src/bash/checkShrinker.sh +++ b/src/bash/checkShrinker.sh @@ -51,6 +51,14 @@ YELLOW='\e[0;33m' BLUE='\e[0;34m' MAGENTA='\e[0;35m' CYAN='\e[0;36m' +GREY='\e[0;90m' +BG_BLACK='\e[0;40m' +BG_RED='\e[0;41m' +BG_GREEN='\e[0;42m' +BG_YELLOW='\e[0;43m' +BG_BLUE='\e[0;44m' +BG_MAGENTA='\e[0;45m' +CYAN='\e[0;36m' NC='\e[0m' # No Color NL=' ' @@ -65,13 +73,27 @@ case "${ATTACH_MODE}" in *) usage;; esac -for mbox in $*; do - clear - echo -e " ${GREEN}${BOLD}${mbox}${NC}\n" - "${FILTER_TEST}" -s -m "${ATTACH_MODE}" "${mbox}" - echo -en "\n(q = quit / default = continue)? " - read rep - case "${rep}" in - "q" ) break;; - esac + +start=0 +loop=true +while [ ! -z "${loop}" ]; do + loop="" + count=0 + for mbox in $*; do + clear + ((count=count+1)) + (( count < start )) && continue + echo -e " ${GREY}${count}/$# ${GREEN}${BOLD}${mbox}${NC}\n" + "${FILTER_TEST}" -s -m "${ATTACH_MODE}" "${mbox}" + echo -en "\n(q = quit / [0-9]* = goto / default = continue)? " + read rep + case "${rep}" in + "q" ) break;; + [0-9]* ) + start="${rep}" + (( count < start )) && continue + loop=true + break;; + esac + done done