Initial push
[termux-packages] / packages / termux-api / termux-dialog
CommitLineData
59f0d218
FF
1#!/system/bin/sh
2
3set -e -u
4
5SCRIPTNAME=$0
6show_usage () {
7 echo "usage: $SCRIPTNAME [OPTIONS]"
8 echo " Show a text entry dialog."
9 echo " -i, --input-hint The input hint to show when the textarea is empty"
10}
11
12PARAMS=""
13O=`busybox getopt -q -l help -l input-hint: -- hi: "$@"`
14if [ $? != 0 ] ; then show_usage; exit 1 ; fi
15eval set -- "$O"
16while true; do
17case "$1" in
18 -h|--help) show_usage; exit 0;;
19 -i|--input-hint) PARAMS="$PARAMS --es input_hint '$2'"; shift 2;;
20 --) shift; break;;
21 *) echo Error; exit 1;;
22esac
23done
24
25# Too many arguments:
26if [ $# != 0 ]; then show_usage; exit 1; fi
27
28eval termux-api DialogReceiver $PARAMS