[Tracker] [PATCH 01/10] tracker-status: add "--version" option



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

diff --git a/src/tracker-utils/tracker-status.c b/src/tracker-utils/tracker-status.c
index 594a11f..60bd9a5 100644
--- a/src/tracker-utils/tracker-status.c
+++ b/src/tracker-utils/tracker-status.c
@@ -51,6 +51,7 @@ static gchar     *pause_reason;
 static gint       resume_cookie = -1;
 static gboolean   follow;
 static gboolean   detailed;
+static gboolean   print_version;
 
 static GOptionEntry entries[] = {
        { "follow", 'f', 0, G_OPTION_ARG_NONE, &follow,
@@ -89,6 +90,10 @@ static GOptionEntry entries[] = {
          N_("Resume a miner (you must use this with --miner)"),
          N_("COOKIE")
        },
+       { "version", 'v', 0, G_OPTION_ARG_NONE, &print_version,
+         N_("Print version"),
+         NULL 
+       },
        { NULL }
 };
 
@@ -335,6 +340,13 @@ main (gint argc, gchar *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 (pause_reason && resume_cookie != -1) {
                gchar *help;
 
-- 
1.6.3.3




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