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() {
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
}