beagle r4670 - in trunk/beagle: BeagleClient tools
- From: dbera svn gnome org
- To: svn-commits-list gnome org
- Subject: beagle r4670 - in trunk/beagle: BeagleClient tools
- Date: Tue, 8 Apr 2008 00:38:48 +0100 (BST)
Author: dbera
Date: Tue Apr 8 00:38:47 2008
New Revision: 4670
URL: http://svn.gnome.org/viewvc/beagle?rev=4670&view=rev
Log:
* Add a QueryDomain.All as a shortcut for all the QueryDomains.
* Replace beagle-query option "--network yes|no" with a proper "--domain ..." with full choice to specify domains.
Modified:
trunk/beagle/BeagleClient/Query.cs
trunk/beagle/tools/Query.cs
Modified: trunk/beagle/BeagleClient/Query.cs
==============================================================================
--- trunk/beagle/BeagleClient/Query.cs (original)
+++ trunk/beagle/BeagleClient/Query.cs Tue Apr 8 00:38:47 2008
@@ -41,7 +41,8 @@
Local = 1,
System = 2,
Neighborhood = 4,
- Global = 8
+ Global = 8,
+ All = 15
}
public class Query : RequestMessage {
Modified: trunk/beagle/tools/Query.cs
==============================================================================
--- trunk/beagle/tools/Query.cs (original)
+++ trunk/beagle/tools/Query.cs Tue Apr 8 00:38:47 2008
@@ -181,7 +181,7 @@
" --max-hits\t\tLimit number of search results per backend\n" +
" \t\t(default 100)\n" +
"\n" +
- " --network <yes|no>\tQuery other beagle systems in the network specified in config (default no)\n" +
+ " --domain <local|system|network|global|all> Specify query domain (default local + system)\n" +
"\n" +
" --flood\t\tExecute the query over and over again. Don't do that.\n" +
" --listener\t\tExecute an index listener query. Don't do that either.\n" +
@@ -247,6 +247,8 @@
query = new Query ();
+ QueryDomain domain = 0;
+
// Parse args
int i = 0;
while (i < args.Length) {
@@ -293,10 +295,33 @@
System.Environment.Exit (0);
break;
- case "--network":
+ case "--domain":
if (++i >= args.Length) PrintUsageAndExit ();
- if (args [i].ToLower () == "yes")
- query.AddDomain (QueryDomain.Neighborhood);
+ switch (args [i].ToLower ()) {
+ case "local":
+ domain |= QueryDomain.Local;
+ break;
+
+ case "system":
+ domain |= QueryDomain.System;
+ break;
+
+ case "network":
+ domain |= QueryDomain.Neighborhood;
+ break;
+
+ case "global":
+ domain |= QueryDomain.Global;
+ break;
+
+ case "all":
+ domain |= QueryDomain.All;
+ break;
+
+ default:
+ PrintUsageAndExit ();
+ break;
+ }
break;
default:
@@ -312,6 +337,9 @@
++i;
}
+ if (domain != 0)
+ query.QueryDomain = domain;
+
if (listener) {
query.IsIndexListener = true;
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]