[Tracker] [PATCH 04/10] tracker-sparql: add "--version" option



---
 src/tracker-utils/tracker-sparql.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/tracker-utils/tracker-sparql.c b/src/tracker-utils/tracker-sparql.c
index a2756e5..90e316e 100644
--- a/src/tracker-utils/tracker-sparql.c
+++ b/src/tracker-utils/tracker-sparql.c
@@ -38,6 +38,7 @@ static gboolean        update;
 static gboolean  list_classes;
 static gboolean  list_class_prefixes;
 static gchar    *list_properties;
+static gboolean  print_version;
 
 static GOptionEntry   entries[] = {
        { "file", 'f', 0, G_OPTION_ARG_FILENAME, &file,
@@ -64,6 +65,10 @@ static GOptionEntry   entries[] = {
          N_("Retrieve properties for a class, prefixes can be used too (e.g. rdfs:Resource)"),
          N_("CLASS"),
        },
+       { "version", 'v', 0, G_OPTION_ARG_NONE, &print_version,
+         N_("Print version"),
+         NULL,
+       },
        { NULL }
 };
 
@@ -161,6 +166,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 (!list_classes && !list_class_prefixes && !list_properties &&
            ((!file && !query) || (file && query))) {
                gchar *help;
-- 
1.6.3.3




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