termux-packages/packages/termux-api/termux-dialog

29 lines
635 B
Plaintext
Raw Normal View History

#!/bin/sh
2015-06-13 01:03:31 +02:00
set -e -u
SCRIPTNAME=$0
show_usage () {
echo "usage: $SCRIPTNAME [OPTIONS]"
echo " Show a text entry dialog."
echo " -i, --input-hint The input hint to show when the textarea is empty"
}
PARAMS=""
O=`busybox getopt -q -l help -l input-hint: -- hi: "$@"`
if [ $? != 0 ] ; then show_usage; exit 1 ; fi
eval set -- "$O"
while true; do
case "$1" in
-h|--help) show_usage; exit 0;;
-i|--input-hint) PARAMS="$PARAMS --es input_hint '$2'"; shift 2;;
--) shift; break;;
*) echo Error; exit 1;;
esac
done
# Too many arguments:
if [ $# != 0 ]; then show_usage; exit 1; fi
eval @TERMUX_API@ Dialog $PARAMS