Add support for passwordbox
This commit is contained in:
parent
e0826f18ac
commit
108c8e34cd
|
@ -92,12 +92,13 @@ useWhiptail() {
|
|||
}
|
||||
|
||||
usePlainText() {
|
||||
inputbox=false; infobox=false; yesno=false
|
||||
inputbox=false; infobox=false; passwordbox=false; yesno=false
|
||||
for item in "$@"; do
|
||||
case $item in
|
||||
--title) shift && shift ;;
|
||||
--inputbox) inputbox=true ;;
|
||||
--infobox) infobox=true ;;
|
||||
--passwordbox) passwordbox=true ;;
|
||||
--yesno) yesno=true ;;
|
||||
esac
|
||||
done
|
||||
|
@ -105,6 +106,9 @@ usePlainText() {
|
|||
if [ $inputbox = true ]; then
|
||||
read -r readVar
|
||||
printf "$readVar" 1>&2
|
||||
elif [ $passwordbox = true ]; then
|
||||
read -r -s readVar
|
||||
printf "$readVar" 1>&2
|
||||
elif [ $yesno = true ]; then
|
||||
printf "[y/n] "
|
||||
read -n 1 -r readVar
|
||||
|
|
Loading…
Reference in New Issue