send-notification: do not send a notification when using "--help"
[platform/core/appfw/notification-service.git] / send_notification.c
index 52e5686..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);
@@ -121,7 +126,7 @@ main(int argc, char **argv)
     }
 
     err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
-                                title ? title : "Default Content",
+                                content ? content : "Default Content",
                                 NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
     if (err != NOTIFICATION_ERROR_NONE) {
         fprintf(stderr, "Unable to set notification content: %s\n", error_to_string(err));