[gitg] Add a --version command line option



commit ef3cb0ea888a78f142d6cdc6a2e7eca1a221cf39
Author: Paolo Borelli <porelli gnome org>
Date:   Sun Aug 2 11:48:49 2009 +0200

    Add a --version command line option

 gitg/gitg.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gitg/gitg.c b/gitg/gitg.c
index b16770c..da1a6d7 100644
--- a/gitg/gitg.c
+++ b/gitg/gitg.c
@@ -38,8 +38,18 @@
 
 static gboolean commit_mode = FALSE;
 
+static void
+show_version_and_quit (void)
+{
+	g_print ("%s - Version %s\n", g_get_application_name (), VERSION);
+
+	exit (0);
+}
+
 static GOptionEntry entries[] = 
 {
+	{ "version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
+	  show_version_and_quit, N_("Show the application's version"), NULL },
 	{ "commit", 'c', 0, G_OPTION_ARG_NONE, &commit_mode, N_("Start gitg in commit mode") }, 
 	{ NULL }
 };



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