diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2016-03-20 12:55:09 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2016-11-20 17:43:49 +0100 |
commit | e1936b68709621302a627d3703bdd7e06db26fcf (patch) | |
tree | 77a9a5cef5ff7d02ce5f8d137de93d1482d5adce | |
parent | b514c3a562bf82180cef4dafef4d41a3d1ba84f8 (diff) | |
download | tracker-e1936b68709621302a627d3703bdd7e06db26fcf.tar.gz |
tracker: Add remote connection support to "tracker sparql" CLI tool
The -r/--remote switch can be used to specify the base url to be used
in queries.
https://bugzilla.gnome.org/show_bug.cgi?id=773031
-rw-r--r-- | src/tracker/tracker-sparql.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/tracker/tracker-sparql.c b/src/tracker/tracker-sparql.c index 23cc6918d..0b4d2679a 100644 --- a/src/tracker/tracker-sparql.c +++ b/src/tracker/tracker-sparql.c @@ -98,6 +98,7 @@ static gchar *tree; static gchar *get_shorthand; static gchar *get_longhand; static gchar *search; +static gchar *remote_url; static GOptionEntry entries[] = { { "file", 'f', 0, G_OPTION_ARG_FILENAME, &file, @@ -148,6 +149,10 @@ static GOptionEntry entries[] = { N_("Returns the full namespace for a class."), N_("CLASS"), }, + { "remote-service", 'r', 0, G_OPTION_ARG_STRING, &remote_url, + N_("Remote service to query to"), + N_("BASE_URL"), + }, { NULL } }; @@ -1070,7 +1075,11 @@ sparql_run (void) TrackerSparqlCursor *cursor; GError *error = NULL; - connection = tracker_sparql_connection_get (NULL, &error); + if (remote_url != NULL) { + connection = tracker_sparql_connection_remote_new (remote_url); + } else { + connection = tracker_sparql_connection_get (NULL, &error); + } if (!connection) { g_printerr ("%s: %s\n", |