diff options
author | Juan A. Suarez Romero <jasuarez@igalia.com> | 2011-04-19 14:53:12 +0000 |
---|---|---|
committer | Juan A. Suarez Romero <jasuarez@igalia.com> | 2011-04-19 14:53:12 +0000 |
commit | 53539b06cea84c4128fcadc1e213e3899a252eb6 (patch) | |
tree | bdb31ab425776b2a23013ccda38d624afe99b51a | |
parent | 42f4809069c9e6c4bc0396d679d5d66c7c6ad881 (diff) |
grl-inspect: Add configuration file
Add option "-c" to pass a file containing configuration options for sources.
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
-rw-r--r-- | tools/grilo-inspect/grl-inspect.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/grilo-inspect/grl-inspect.c b/tools/grilo-inspect/grl-inspect.c index 0827efc..9c3f8f1 100644 --- a/tools/grilo-inspect/grl-inspect.c +++ b/tools/grilo-inspect/grl-inspect.c @@ -29,6 +29,7 @@ GRL_LOG_DOMAIN_STATIC(grl_inspect_log_domain); static gint delay = 0; static GMainLoop *mainloop = NULL; static gchar **introspect_sources = NULL; +static gchar *conffile = NULL; static GrlPluginRegistry *registry = NULL; static GOptionEntry entries[] = { @@ -36,6 +37,10 @@ static GOptionEntry entries[] = { G_OPTION_ARG_INT, &delay, "Wait some seconds before showing results", NULL }, + { "config", 'c', 0, + G_OPTION_ARG_STRING, &conffile, + "Configuration file to send to sources", + NULL }, { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &introspect_sources, "Sources to introspect", @@ -202,6 +207,14 @@ main (int argc, char *argv[]) GRL_LOG_DOMAIN_INIT (grl_inspect_log_domain, "grl-inspect"); registry = grl_plugin_registry_get_default (); + if (conffile) { + grl_plugin_registry_add_config_from_file (registry, conffile, &error); + if (error) { + GRL_WARNING ("Unable to load configuration: %s", error->message); + g_error_free (error); + } + } + mainloop = g_main_loop_new (NULL, FALSE); grl_plugin_registry_load_all (registry, NULL); |