[tracker] tracker-info: add "--version" option



commit 44100648e186c332f97edb95a0ed4d23d3bb29d3
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Wed Nov 18 10:08:25 2009 +0100

    tracker-info: add "--version" option

 src/tracker-utils/tracker-info.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-utils/tracker-info.c b/src/tracker-utils/tracker-info.c
index f94fecc..1856846 100644
--- a/src/tracker-utils/tracker-info.c
+++ b/src/tracker-utils/tracker-info.c
@@ -33,8 +33,13 @@
 #include <libtracker-common/tracker-common.h>
 
 static gchar        **filenames = NULL;
+static gboolean       print_version;
 
 static GOptionEntry   entries[] = {
+	{ "version", 'v', 0, G_OPTION_ARG_NONE, &print_version,
+	  N_("Print version"),
+	  NULL,
+	},
 	{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames,
 	  N_("FILE"),
 	  N_("FILE")},
@@ -91,6 +96,13 @@ main (int argc, char **argv)
 	g_option_context_add_main_entries (context, entries, NULL);
 	g_option_context_parse (context, &argc, &argv, NULL);
 
+     	if (print_version) {
+		g_print ("%s\n", PACKAGE_STRING);
+		g_option_context_free (context);
+
+		return EXIT_SUCCESS;
+	}
+
 	if (!filenames) {
 		gchar *help;
 



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