termux-api: Add termux-vibrate -f/--force option
[termux-packages] / packages / termux-api / termux-download
CommitLineData
cc1ae02e 1#!/bin/sh
59f0d218
FF
2
3set -e -u
4
5SCRIPTNAME=$0
6show_usage () {
7 echo "usage: termux-download <uri-to-download>"
8 echo " Download a resource using the system download manager."
9 echo " -d, --description Description for the download request notification"
10 echo " -t, --title Title for the download request notification"
11}
12
13PARAMS=""
14O=`busybox getopt -q -l description: -l title: -l help -- d:t:h "$@"`
15if [ $? != 0 ] ; then show_usage; exit 1 ; fi
16eval set -- "$O"
17while true; do
18case "$1" in
19 -h|--help) show_usage; exit 0;;
20 -d|--description) PARAMS="$PARAMS --es description '$2'"; shift 2;;
21 -t|--title) PARAMS="$PARAMS --es title '$2'"; shift 2;;
22 --) shift; break;;
23 *) echo Error; exit 1;;
24esac
25done
26
27# Too many arguments:
28if [ $# != 1 ]; then show_usage; exit 1; fi
29
cc1ae02e 30eval @TERMUX_API@ Download $PARAMS $1