From 962e5b54fc32afdfaf5aca429ae8d88aefeb7631 Mon Sep 17 00:00:00 2001 From: Rezart Qelibari Date: Tue, 19 Apr 2022 08:03:51 +0200 Subject: [PATCH] Update option filter function --- install.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 828e2d7..3544d05 100755 --- a/install.sh +++ b/install.sh @@ -43,13 +43,11 @@ function generateModuleOptions() { } function filterPasswordOptions() { - local i optname optval - for ((i=1; i <= ${#moduleOptions}; i+=2)); do - optname=${moduleOptions[$i]} - optval=${moduleOptions[$i+1]} - filteredOptions+=($optname) - [[ $optname =~ password ]] && optval='******' - filteredOptions+=($optval) + local opt= hide=false + for opt in ${moduleOptions}; do + [[ $opt =~ ^--?.*password ]] && hide=true + [[ ${hide} = true ]] && { opt='******'; hide=false } + filteredOptions+=($opt) done }