4 SCRIPTNAME=termux-dialog
6 echo "Usage: $SCRIPTNAME [-i hint] [-m] [-p] [-t title]"
7 echo "Show a text entry dialog."
8 echo " -i hint the input hint to show when the input is empty"
9 echo " -m use a textarea with multiple lines instead of a single"
10 echo " -p enter the input as a password"
11 echo " -t title the title to show for the input prompt"
24 while getopts :hi:mpt: option
28 i) ARG_I="--es input_hint"; OPT_I="$OPTARG";;
29 m) ARG_M="--ez multiple_lines true";;
30 p) ARG_P="--es input_type password";;
31 t) ARG_T="--es input_title"; OPT_T="$OPTARG";;
32 ?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
37 if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
40 if [ -n "$ARG_I" ]; then set -- "$@" $ARG_I "$OPT_I"; fi
41 if [ -n "$ARG_T" ]; then set -- "$@" $ARG_T "$OPT_T"; fi
43 @TERMUX_API@ Dialog "$@"