File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /data/data/com.termux/files/usr/bin/bash
2+ set -u
3+
4+ PARAM_LIMIT=10
5+ PARAM_OFFSET=0
6+ PARAMS=" "
7+
8+ SCRIPTNAME=termux-call-log
9+
10+ show_usage () {
11+ echo " Usage: $SCRIPTNAME [-d] [-l limit] [-o offset]"
12+ echo " List call log history"
13+ echo " -l limit offset in call log list (default: $PARAM_LIMIT )"
14+ echo " -o offset offset in call log list (default: $PARAM_OFFSET )"
15+ exit 0
16+ }
17+
18+ while getopts :hl:o: option
19+ do
20+ case " $option " in
21+ h) show_usage;;
22+ l) PARAM_LIMIT=$OPTARG ;;
23+ o) PARAM_OFFSET=$OPTARG ;;
24+ ? ) echo " $SCRIPTNAME : illegal option -$OPTARG " ; exit 1;
25+ esac
26+ done
27+ shift $(( $OPTIND - 1 ))
28+
29+ if [ $# != 0 ]; then echo " $SCRIPTNAME : too many arguments" ; exit 1; fi
30+
31+ PARAMS=" $PARAMS --ei offset $PARAM_OFFSET --ei limit $PARAM_LIMIT "
32+ /data/data/com.termux/files/usr/libexec/termux-api CallLog $PARAMS
You can’t perform that action at this time.
0 commit comments