termux-notification: Improve argument handling

This commit is contained in:
Fredrik Fornwall 2015-08-14 15:44:19 -04:00
parent cc1ae02e2e
commit 5b8f3e4af3
1 changed files with 4 additions and 4 deletions

View File

@ -20,11 +20,11 @@ if [ $? != 0 ] ; then show_usage; exit 1 ; fi
eval set -- "$O"
while true; do
case "$1" in
-c|--content) PARAMS="$PARAMS --es content $2"; CONTENT_OR_TITLE_SET=yes; shift 2;;
-c|--content) PARAMS="$PARAMS --es content '$2'"; CONTENT_OR_TITLE_SET=yes; shift 2;;
-h|--help) show_usage; exit 0;;
-i|--id) PARAMS="$PARAMS --es id $2"; shift 2;;
-t|--title) PARAMS="$PARAMS --es title $2"; CONTENT_OR_TITLE_SET=yes; shift 2;;
-u|--url) PARAMS="$PARAMS --es url $2"; shift 2;;
-t|--title) PARAMS="$PARAMS --es title '$2'"; CONTENT_OR_TITLE_SET=yes; shift 2;;
-u|--url) PARAMS="$PARAMS --es url '$2'"; shift 2;;
--) shift; break;;
*) echo Error; exit 1;;
esac
@ -35,4 +35,4 @@ if [ $CONTENT_OR_TITLE_SET = "no" ]; then
exit 1;
fi;
@TERMUX_API@ Notification $PARAMS
eval @TERMUX_API@ Notification $PARAMS