Browse Source

termux-notification: Improve argument handling

android-5
Fredrik Fornwall 9 years ago
parent
commit
5b8f3e4af3
  1. 8
      packages/termux-api/termux-notification

8
packages/termux-api/termux-notification

@ -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

Loading…
Cancel
Save