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