Update option filter function

This commit is contained in:
Rezart Qelibari
2022-04-19 08:03:51 +02:00
parent 5e65a5cd2c
commit 962e5b54fc

View File

@@ -43,13 +43,11 @@ function generateModuleOptions() {
} }
function filterPasswordOptions() { function filterPasswordOptions() {
local i optname optval local opt= hide=false
for ((i=1; i <= ${#moduleOptions}; i+=2)); do for opt in ${moduleOptions}; do
optname=${moduleOptions[$i]} [[ $opt =~ ^--?.*password ]] && hide=true
optval=${moduleOptions[$i+1]} [[ ${hide} = true ]] && { opt='******'; hide=false }
filteredOptions+=($optname) filteredOptions+=($opt)
[[ $optname =~ password ]] && optval='******'
filteredOptions+=($optval)
done done
} }