[evolution/gnome-3-2] Add a hidden --version option.



commit f3d3f25d1648154cf29fc29de3fdc3151d6f05b9
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Dec 8 08:58:08 2011 -0500

    Add a hidden --version option.
    
    Required by GNU Coding Standards.
    
    (cherry picked from commit 2f32e1cc68cd416f4530ecc3d2ff08b0e6498d45)

 shell/main.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/shell/main.c b/shell/main.c
index fd0b050..36e67d1 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -289,6 +289,17 @@ handle_term_signal (gpointer data)
 #endif
 #endif
 
+G_GNUC_NORETURN static gboolean
+option_version_cb (const gchar *option_name,
+                   const gchar *option_value,
+                   gpointer data,
+                   GError **error)
+{
+	g_print ("%s\n", PACKAGE_STRING);
+
+	exit (0);
+}
+
 static GOptionEntry entries[] = {
 #ifdef G_OS_WIN32
 	{ "register-handlers", '\0', G_OPTION_FLAG_HIDDEN,
@@ -334,6 +345,8 @@ static GOptionEntry entries[] = {
 	  N_("Import URIs or file names given as rest of arguments."), NULL },
 	{ "quit", 'q', 0, G_OPTION_ARG_NONE, &quit,
 	  N_("Request a running Evolution process to quit"), NULL },
+	{ "version", 'v', G_OPTION_FLAG_HIDDEN | G_OPTION_FLAG_NO_ARG,
+	  G_OPTION_ARG_CALLBACK, option_version_cb, NULL, NULL },
 	{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY,
 	  &remaining_args, NULL, NULL },
 	{ NULL }



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