[gnome-screenshot] Add command line option --version



commit 2a5aa37196502fea1aff8dbf342dba15f96d2cd8
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date:   Sat Jul 13 00:48:23 2013 +0200

    Add command line option --version
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698658

 src/screenshot-application.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/screenshot-application.c b/src/screenshot-application.c
index 3cdddf5..2d945cc 100644
--- a/src/screenshot-application.c
+++ b/src/screenshot-application.c
@@ -635,6 +635,7 @@ screenshot_application_local_command_line (GApplication *app,
   gchar *border_effect_arg = NULL;
   guint delay_arg = 0;
   gchar *file_arg = NULL;
+  gboolean version_arg = FALSE;
   const GOptionEntry entries[] = {
     { "clipboard", 'c', 0, G_OPTION_ARG_NONE, &clipboard_arg, N_("Send the grab directly to the clipboard"), 
NULL },
     { "window", 'w', 0, G_OPTION_ARG_NONE, &window_arg, N_("Grab a window instead of the entire screen"), 
NULL },
@@ -646,6 +647,7 @@ screenshot_application_local_command_line (GApplication *app,
     { "border-effect", 'e', 0, G_OPTION_ARG_STRING, &border_effect_arg, N_("Effect to add to the border 
(shadow, border or none)"), N_("effect") },
     { "interactive", 'i', 0, G_OPTION_ARG_NONE, &interactive_arg, N_("Interactively set options"), NULL },
     { "file", 'f', 0, G_OPTION_ARG_FILENAME, &file_arg, N_("Save screenshot directly to this file"), 
N_("filename") },
+    { "version", 0, 0, G_OPTION_ARG_NONE, &version_arg, N_("Print version information and exit"), NULL },
     { NULL },
   };
 
@@ -672,6 +674,12 @@ screenshot_application_local_command_line (GApplication *app,
       goto out;
     }
 
+  if (version_arg)
+    {
+      g_print ("%s %s\n", g_get_application_name (), VERSION);
+      goto out;
+    }
+
   res = screenshot_load_config (clipboard_arg,
                                 window_arg,
                                 area_arg,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]