Use more source checksums
[termux-packages] / packages / termux-api / termux-toast
... / ...
CommitLineData
1#!/bin/sh
2set -e -u
3
4SCRIPTNAME=termux-toast
5show_usage () {
6 echo "Usage: termux-toast [-s] [text]"
7 echo "Show text in a Toast (a transient popup). The text to show is either supplied as arguments or read from stdin if no arguments are given."
8 echo " -s only show the toast for a short while"
9 exit 0
10}
11
12PARAMS=""
13while getopts :hs option
14do
15 case "$option" in
16 h) show_usage;;
17 s) PARAMS="--ez short true";;
18 ?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
19 esac
20done
21shift $(($OPTIND-1))
22
23CMD="@TERMUX_API@ Toast $PARAMS"
24if [ $# = 0 ]; then
25 $CMD
26else
27 echo $@ | $CMD
28fi