[grilo] grl-inspect: Add print version option
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] grl-inspect: Add print version option
- Date: Mon, 16 Apr 2012 18:21:52 +0000 (UTC)
commit ba3a8c0cf1f60da33919a5267524cfb8505a494f
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Mon Apr 16 17:53:44 2012 +0000
grl-inspect: Add print version option
Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
tools/grilo-inspect/grl-inspect.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/tools/grilo-inspect/grl-inspect.c b/tools/grilo-inspect/grl-inspect.c
index 11f76ef..6f1f54a 100644
--- a/tools/grilo-inspect/grl-inspect.c
+++ b/tools/grilo-inspect/grl-inspect.c
@@ -23,6 +23,8 @@
#include <grilo.h>
#include <glib.h>
+#include "config.h"
+
#define GRL_LOG_DOMAIN_DEFAULT grl_inspect_log_domain
GRL_LOG_DOMAIN_STATIC(grl_inspect_log_domain);
@@ -31,6 +33,7 @@ static GMainLoop *mainloop = NULL;
static gchar **introspect_sources = NULL;
static gchar *conffile = NULL;
static GrlPluginRegistry *registry = NULL;
+static gboolean version;
static GOptionEntry entries[] = {
{ "delay", 'd', 0,
@@ -41,6 +44,10 @@ static GOptionEntry entries[] = {
G_OPTION_ARG_STRING, &conffile,
"Configuration file to send to sources",
NULL },
+ { "version", 'V', 0,
+ G_OPTION_ARG_NONE, &version,
+ "Print version",
+ NULL },
{ G_OPTION_REMAINING, '\0', 0,
G_OPTION_ARG_STRING_ARRAY, &introspect_sources,
"Sources to introspect",
@@ -82,6 +89,14 @@ print_keys (const GList *keys)
}
static void
+print_version()
+{
+ g_print ("grl-inspect-" GRL_MAJORMINOR " version " VERSION "\n");
+ g_print ("Grilo " VERSION "\n");
+ g_print ("http://live.gnome.org/Grilo\n");
+}
+
+static void
introspect_source (const gchar *source_id)
{
GrlMediaPlugin *source;
@@ -213,6 +228,11 @@ main (int argc, char *argv[])
return -1;
}
+ if (version) {
+ print_version ();
+ return 0;
+ }
+
grl_init (&argc, &argv);
GRL_LOG_DOMAIN_INIT (grl_inspect_log_domain, "grl-inspect");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]