[Xfce4-commits] [apps/xfce4-screenshooter] 02/14: Add cli options

noreply at xfce.org noreply at xfce.org
Mon Dec 15 22:34:56 CET 2014


This is an automated email from the git hooks/post-receive script.

landry pushed a commit to branch master
in repository apps/xfce4-screenshooter.

commit e1655589b9fda11d1faf2bf1fb135280f5810777
Author: Sebastian Waisbrot <seppo0010 at gmail.com>
Date:   Sat Jul 16 17:19:47 2011 -0300

    Add cli options
---
 src/main.c |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/src/main.c b/src/main.c
index bf9307a..59b050f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -35,6 +35,7 @@ gboolean fullscreen = FALSE;
 gboolean mouse = FALSE;
 gboolean upload = FALSE;
 gboolean clipboard = FALSE;
+gboolean upload_imgur = FALSE;
 gchar *screenshot_dir;
 gchar *application;
 gint delay = 0;
@@ -87,6 +88,11 @@ static GOptionEntry entries[] =
     NULL
   },
   {
+    "imgur", 'i', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &upload_imgur,
+    N_("Host the screenshot on Imgur, a free online image hosting service"),
+    NULL
+  },
+  {
     "version", 'V', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &version,
     N_("Version information"),
     NULL
@@ -230,6 +236,21 @@ int main (int argc, char **argv)
       g_free (sd);
       return EXIT_FAILURE;
     }
+  else if (upload_imgur && upload)
+    {
+      g_printerr (conflict_error, "upload", "imgur");
+      return EXIT_FAILURE;
+    }
+  else if (upload_imgur && (screenshot_dir != NULL))
+    {
+      g_printerr (conflict_error, "imgur", "save");
+      return EXIT_FAILURE;
+    }
+  else if (upload_imgur && (application != NULL))
+    {
+      g_printerr (conflict_error, "imgur", "open");
+      return EXIT_FAILURE;
+    }
 
   /* Warn that action options, mouse and delay will be ignored in
    * non-cli mode */
@@ -237,6 +258,8 @@ int main (int argc, char **argv)
     g_printerr (ignore_error, "open");
   if ((screenshot_dir != NULL)  && !(fullscreen || window || region ))
     g_printerr (ignore_error, "save");
+  if (upload_imgur && !(fullscreen || window || region))
+    g_printerr (ignore_error, "imgur");
   if (upload && !(fullscreen || window || region))
     g_printerr (ignore_error, "upload");
   if (clipboard && !(fullscreen || window || region))
@@ -310,6 +333,11 @@ int main (int argc, char **argv)
           sd->app = g_strdup ("none");
           sd->action = CLIPBOARD;
           sd->action_specified = TRUE;
+      else if (upload_imgur)
+        {
+          sd->app = g_strdup ("none");
+          sd->action = UPLOAD_IMGUR;
+          sd->action_specified = TRUE;
         }
       else
         {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list