[Tracker] [PATCH 08/10] tracker-control: add "--version" option



---
 src/tracker-control/tracker-control.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/tracker-control/tracker-control.c b/src/tracker-control/tracker-control.c
index 6362468..24a6aeb 100644
--- a/src/tracker-control/tracker-control.c
+++ b/src/tracker-control/tracker-control.c
@@ -45,6 +45,7 @@ static gboolean     soft_reset;
 static gboolean     remove_config;
 static gboolean     remove_thumbnails;
 static gboolean     start;
+static gboolean     print_version;
 
 static GOptionEntry entries[] = {
        { "kill", 'k', 0, G_OPTION_ARG_NONE, &should_kill,
@@ -69,6 +70,9 @@ static GOptionEntry entries[] = {
        { "start", 's', 0, G_OPTION_ARG_NONE, &start,
          N_("Starts miners (which indirectly starts tracker-store too)"),
          NULL },
+       { "version", 'v', 0, G_OPTION_ARG_NONE, &print_version,
+         N_("Print version"),
+         NULL },
        { NULL }
 };
 
@@ -209,6 +213,11 @@ main (int argc, char **argv)
        g_option_context_parse (context, &argc, &argv, NULL);
        g_option_context_free (context);
 
+       if (print_version) {
+               g_print ("%s\n", PACKAGE_STRING);
+               return EXIT_SUCCESS;
+       }
+
        if (should_kill && should_terminate) {
                g_printerr ("%s\n",
                            _("You can not use the --kill and --terminate arguments together"));
-- 
1.6.3.3




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