From 5c1deada45c2f66ba1f493bee8bc333914e0ff29 Mon Sep 17 00:00:00 2001 From: Manuel Bachmann Date: Tue, 20 May 2014 11:43:35 +0200 Subject: [PATCH] send-notification: do not send a notification when using "--help" The "--help" option should make the program display the help text and return directly, not sending a blank notification. Change-Id: Ifb2f9ede3b64338cba792c6b98a9e9f610fd5a11 Signed-off-by: Manuel Bachmann --- send_notification.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/send_notification.c b/send_notification.c index 0a15d86..a42b9dd 100644 --- a/send_notification.c +++ b/send_notification.c @@ -75,6 +75,7 @@ main(int argc, char **argv) char *icon = NULL; char *image = NULL; int imageType = 0; + Eina_Bool quit = EINA_FALSE; Eina_Bool remove = EINA_FALSE; notification_h noti = NULL; notification_error_e err = NOTIFICATION_ERROR_NONE; @@ -85,7 +86,8 @@ main(int argc, char **argv) ECORE_GETOPT_VALUE_STR(icon), ECORE_GETOPT_VALUE_STR(image), ECORE_GETOPT_VALUE_INT(imageType), - ECORE_GETOPT_VALUE_NONE + ECORE_GETOPT_VALUE_NONE, + ECORE_GETOPT_VALUE_BOOL(quit) }; if (!ecore_init()) { @@ -98,6 +100,9 @@ main(int argc, char **argv) return -1; } + if (quit) + return 0; + noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE); -- 2.7.4