stunnel: Update from 5.37 to 5.38
[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 ""
9 echo " -s only show the toast for a short while"
10 echo ""
11 exit 0
12}
13
14PARAMS=""
15while getopts :hs option
16do
17 case "$option" in
18 h) show_usage;;
19 s) PARAMS="--ez short true";;
20 ?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
21 esac
22done
23shift $(($OPTIND-1))
24
25CMD="@TERMUX_API@ Toast $PARAMS"
26if [ $# = 0 ]; then
27 $CMD
28else
29 echo $@ | $CMD
30fi