X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/c409b567caf4d71b965bc3331580e8ce1221565f..e97137242f065544a59bdc917fa428bf0a1ebbd8:/packages/termux-api/termux-dialog diff --git a/packages/termux-api/termux-dialog b/packages/termux-api/termux-dialog index c5555ef8..f827b2e0 100755 --- a/packages/termux-api/termux-dialog +++ b/packages/termux-api/termux-dialog @@ -1,4 +1,4 @@ -#!/system/bin/sh +#!/bin/sh set -e -u @@ -6,17 +6,23 @@ 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" + echo " -i, --input-hint The input hint to show when the input is empty" + echo " -m, --multiple-lines Use a textarea with multiple lines instead of a single" + echo " -p, --password Enter the input as a password" + echo " -t, --title The title to show for the input prompt" } PARAMS="" -O=`busybox getopt -q -l help -l input-hint: -- hi: "$@"` +O=`busybox getopt -q -l help -l input-hint: -l multiple-lines -l password -l title: -- hi:mpt: "$@"` 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;; + -m|--multiple-lines) PARAMS="$PARAMS --ez multiple_lines true"; shift 1;; + -p|--password) PARAMS="$PARAMS --es input_type password"; shift 1;; + -t|--title) PARAMS="$PARAMS --es input_title '$2'"; shift 2;; --) shift; break;; *) echo Error; exit 1;; esac @@ -25,4 +31,4 @@ done # Too many arguments: if [ $# != 0 ]; then show_usage; exit 1; fi -eval termux-api Dialog $PARAMS +eval @TERMUX_API@ Dialog $PARAMS