[tracker] tracker-stats: add "--version" option
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] tracker-stats: add "--version" option
- Date: Wed, 18 Nov 2009 09:21:38 +0000 (UTC)
commit 2dea273a260f73c4d830d816b6a335853c93539a
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Wed Nov 18 10:08:21 2009 +0100
tracker-stats: add "--version" option
src/tracker-utils/tracker-stats.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-utils/tracker-stats.c b/src/tracker-utils/tracker-stats.c
index 1bc1092..b1cc55b 100644
--- a/src/tracker-utils/tracker-stats.c
+++ b/src/tracker-utils/tracker-stats.c
@@ -31,6 +31,16 @@
#include <libtracker-client/tracker.h>
+static gboolean print_version;
+
+static GOptionEntry entries[] = {
+ { "version", 'v', 0, G_OPTION_ARG_NONE, &print_version,
+ N_("Print version"),
+ NULL
+ },
+ { NULL }
+};
+
static void
get_meta_table_data (gpointer value)
{
@@ -68,7 +78,16 @@ main (int argc, char **argv)
/* Translators: this messagge will apper immediately after the */
/* usage string - Usage: COMMAND [OPTION]... <THIS_MESSAGE> */
context = g_option_context_new (_(" - Show statistics for all Nepomuk defined ontology classes"));
+ 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;
+ }
+
g_option_context_free (context);
client = tracker_connect (FALSE, G_MAXINT);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]