2015-08-14 21:27:47 +02:00
|
|
|
#!/bin/sh
|
2015-07-29 04:09:18 +02:00
|
|
|
|
|
|
|
show_usage () {
|
|
|
|
echo "usage: termux-toast [-s|--short]"
|
|
|
|
echo "Show the text from stdin in a Toast (a transient popup). Options:"
|
|
|
|
echo " -s, --short only show the toast for a short while"
|
|
|
|
}
|
|
|
|
|
|
|
|
PARAMS=""
|
|
|
|
O=`busybox getopt -q -l short -l help -- sh "$@"`
|
|
|
|
if [ $? != 0 ] ; then show_usage; exit 1 ; fi
|
|
|
|
eval set -- "$O"
|
|
|
|
while true; do
|
|
|
|
case "$1" in
|
|
|
|
-s|--short) PARAMS="$PARAMS --ez short true"; shift 1;;
|
|
|
|
-h|--help) show_usage; exit 0;;
|
|
|
|
--) shift; break;;
|
|
|
|
*) echo Error; exit 1;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ $# != 0 ]; then show_usage; exit 1; fi
|
|
|
|
|
2015-08-14 21:27:47 +02:00
|
|
|
@TERMUX_API@ Toast $PARAMS
|