Add --password flag to termux-dialog

This commit is contained in:
Fredrik Fornwall 2015-10-27 00:54:49 +01:00
parent c56d5ac07f
commit abe8a8de2b

View File

@ -6,17 +6,19 @@ SCRIPTNAME=$0
show_usage () { show_usage () {
echo "usage: $SCRIPTNAME [OPTIONS]" echo "usage: $SCRIPTNAME [OPTIONS]"
echo " Show a text entry dialog." echo " Show a text entry dialog."
echo " -i, --input-hint The input hint to show when the textarea is empty" echo " -i, --input-hint <hint> The input hint to show when the input is empty"
echo " -p, --password Enter the input as a password"
} }
PARAMS="" PARAMS=""
O=`busybox getopt -q -l help -l input-hint: -- hi: "$@"` O=`busybox getopt -q -l help -l input-hint: -l password -- hi:p "$@"`
if [ $? != 0 ] ; then show_usage; exit 1 ; fi if [ $? != 0 ] ; then show_usage; exit 1 ; fi
eval set -- "$O" eval set -- "$O"
while true; do while true; do
case "$1" in case "$1" in
-h|--help) show_usage; exit 0;; -h|--help) show_usage; exit 0;;
-i|--input-hint) PARAMS="$PARAMS --es input_hint '$2'"; shift 2;; -i|--input-hint) PARAMS="$PARAMS --es input_hint '$2'"; shift 2;;
-p|--password) PARAMS="$PARAMS --es input_type password"; shift 1;;
--) shift; break;; --) shift; break;;
*) echo Error; exit 1;; *) echo Error; exit 1;;
esac esac