File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,24 +3,37 @@ set -e -u
33
44SCRIPTNAME=termux-fingerprint
55show_usage () {
6- echo " Usage: $SCRIPTNAME "
6+ echo " Usage: $SCRIPTNAME [-t title] [-d description] [-s subtitle] [-c cancel] "
77 echo " Use fingerprint sensor on device to check for authentication"
88 echo " NOTE: Only available on Marshmallow and later"
99 exit 0
1010}
1111
12- while getopts :h option
12+ ARG_T=" "
13+ OPT_T=" "
14+ ARG_D=" "
15+ OPT_D=" "
16+ ARG_S=" "
17+ OPT_S=" "
18+ ARG_C=" "
19+ OPT_C=" "
20+
21+ while getopts :ht:d:s:c: option
1322do
1423 case " $option " in
1524 h) show_usage;;
25+ t) ARG_T=" --es title" ; OPT_T=" $OPTARG " ;;
26+ d) ARG_D=" --es description" ; OPT_D=" $OPTARG " ;;
27+ s) ARG_S=" --es subtitle" ; OPT_S=" $OPTARG " ;;
28+ c) ARG_C=" --es cancel" ; OPT_C=" $OPTARG " ;;
1629 ? ) echo " $SCRIPTNAME : illegal option -$OPTARG " ; exit 1;
1730 esac
1831done
19- shift $(( $OPTIND - 1 ))
2032
21- if [ $# -ne 0 ]; then
22- echo " $SCRIPTNAME takes no arguments"
23- exit 1
24- fi
33+ set --
34+ if [ -n " $ARG_T " ]; then set -- " $@ " $ARG_T " $OPT_T " ; fi
35+ if [ -n " $ARG_D " ]; then set -- " $@ " $ARG_D " $OPT_D " ; fi
36+ if [ -n " $ARG_S " ]; then set -- " $@ " $ARG_S " $OPT_S " ; fi
37+ if [ -n " $ARG_C " ]; then set -- " $@ " $ARG_C " $OPT_C " ; fi
2538
26- /data/data/com.termux/files/usr/libexec/termux-api Fingerprint
39+ /data/data/com.termux/files/usr/libexec/termux-api Fingerprint " $@ "
You can’t perform that action at this time.
0 commit comments