From: Fredrik Fornwall Date: Mon, 26 Oct 2015 23:54:49 +0000 (+0100) Subject: Add --password flag to termux-dialog X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/termux-packages/commitdiff_plain/abe8a8de2b1eeac0ee2693525e0bed3631b35fe7?ds=inline;hp=--cc Add --password flag to termux-dialog --- abe8a8de2b1eeac0ee2693525e0bed3631b35fe7 diff --git a/packages/termux-api/termux-dialog b/packages/termux-api/termux-dialog index 073c60e4..640edd16 100755 --- a/packages/termux-api/termux-dialog +++ b/packages/termux-api/termux-dialog @@ -6,17 +6,19 @@ 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 " -p, --password Enter the input as a password" } 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 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;; + -p|--password) PARAMS="$PARAMS --es input_type password"; shift 1;; --) shift; break;; *) echo Error; exit 1;; esac