termux-api: Add termux-vibrate -f/--force option
[termux-packages] / packages / termux-api / termux-sms-inbox
CommitLineData
cc1ae02e 1#!/bin/sh
59f0d218
FF
2set -u
3
4PARAM_LIMIT=10
5PARAM_OFFSET=0
6PARAMS=""
7
8SCRIPTNAME=$0
9show_usage () {
10 echo "usage: termux-sms-inbox [OPTIONS]"
11 echo "List received SMS messages."
12 echo ""
13 echo "Options are all optional."
14 echo " -d, --show-dates show dates"
15 echo " -n, --show-phone-numbers show phone numbers"
16 echo " -o, --offset offset in sms list (default: $PARAM_OFFSET)"
17 echo " -l, --limit offset in sms list (default: $PARAM_LIMIT)"
18}
19
20O=`busybox getopt -q -l help -l show-dates -l show-phone-numbers -l limit: -l offset: -- dhl:no: "$@"`
21if [ $? != 0 ] ; then show_usage; exit 1 ; fi
22eval set -- "$O"
23while true; do
24case "$1" in
25 -h|--help) show_usage; exit 0;;
26 -l|--limit) PARAM_LIMIT=$2; shift 2;;
27 -o|--offset) PARAM_OFFSET=$2; shift 2;;
28 -d|--show-dates) PARAMS="$PARAMS --ez show-dates true"; shift;;
29 -n|--show-phone-numbers) PARAMS="$PARAMS --ez show-phone-numbers true"; shift;;
30 --) shift; break;;
31 *) echo Error; exit 1;;
32esac
33done
34
35# Too many arguments:
36if [ $# != 0 ]; then show_usage; exit 1; fi
37
38PARAMS="$PARAMS --ei offset $PARAM_OFFSET --ei limit $PARAM_LIMIT"
39
cc1ae02e 40@TERMUX_API@ SmsInbox $PARAMS