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



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

    tracker-search: add "--version" option

 src/tracker-utils/tracker-search.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-utils/tracker-search.c b/src/tracker-utils/tracker-search.c
index 3d58e7e..7933906 100644
--- a/src/tracker-utils/tracker-search.c
+++ b/src/tracker-utils/tracker-search.c
@@ -44,6 +44,7 @@ static gboolean       music_files;
 static gboolean       image_files;
 static gboolean       video_files;
 static gboolean       document_files;
+static gboolean       print_version;
 
 static GOptionEntry   entries[] = {
 	{ "limit", 'l', 0, G_OPTION_ARG_INT, &limit,
@@ -94,6 +95,10 @@ static GOptionEntry   entries[] = {
 	  N_("Search for document files"),
 	  NULL
 	},
+	{ "version", 'V', 0, G_OPTION_ARG_NONE, &print_version,
+	  N_("Print version"),
+	  NULL
+	},
 	{ G_OPTION_REMAINING, 0, 0,
 	  G_OPTION_ARG_STRING_ARRAY, &terms,
 	  N_("search terms"),
@@ -793,7 +798,14 @@ main (int argc, char **argv)
 	g_option_context_parse (context, &argc, &argv, NULL);
 
 	g_free (summary);
-	
+
+	if (print_version) {
+		g_print ("%s\n", PACKAGE_STRING);
+		g_option_context_free (context);
+
+		return EXIT_SUCCESS;
+	}
+
 	if (!music_albums && !music_artists && !music_files &&
 	    !image_files &&
 	    !video_files &&



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