[evolution] Add a hidden --version option.



commit 2f32e1cc68cd416f4530ecc3d2ff08b0e6498d45
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.

 shell/main.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/shell/main.c b/shell/main.c
index c8ce8a0..7681802 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -281,6 +281,17 @@ handle_term_signal (gpointer data)
 }
 #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,
@@ -326,6 +337,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]