send-notification: do not send a notification when using "--help" 24/21424/1
authorManuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Tue, 20 May 2014 09:43:35 +0000 (11:43 +0200)
committerManuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Tue, 20 May 2014 09:43:35 +0000 (11:43 +0200)
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 <manuel.bachmann@open.eurogiciel.org>
send_notification.c

index 0a15d86..a42b9dd 100644 (file)
@@ -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);