X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=shell.tcl;h=9b64f68ea0c9003fd85f69b2defe86acfe171ffd;hb=d026c3e06f6e19e5ed4174ab1a504a4b5af79183;hp=5fc0415844b8b3489fca5d5bc1cb83dffe70c87d;hpb=8af4265740ee668a449d31abc97f60aabe0c497d;p=ir-tcl-moved-to-github.git
diff --git a/shell.tcl b/shell.tcl
index 5fc0415..9b64f68 100644
--- a/shell.tcl
+++ b/shell.tcl
@@ -1,4 +1,4 @@
-# $Id: shell.tcl,v 1.5 1998-05-20 12:27:45 adam Exp $
+# $Id: shell.tcl,v 1.8 2002-03-21 11:11:53 adam Exp $
#
if {[catch {ir-log-init all irtcl shell.log}]} {
@@ -21,6 +21,7 @@ proc help {} {
puts " base "
puts " format "
puts " find "
+ puts " sort "
puts " show "
puts ""
}
@@ -76,12 +77,23 @@ proc find-response {z} {
if {$sstatus} {
set h [$z resultCount]
puts "Search ok. $h hits"
+ set terms [$z searchResult]
+ foreach tc $terms {
+ puts "[lindex $tc 0]: [lindex $tc 1]"
+ }
} else {
puts "Search failed"
}
common-response $z 1
}
+proc sort-response {z} {
+ global ok
+ set sstatus [$z sortStatus]
+ puts "Sort Status: $sstatus"
+ set ok 1
+}
+
proc common-response {z from} {
global ok pref
@@ -145,3 +157,13 @@ proc find {query} {
return {}
}
+proc sort {query flags} {
+ global ok pref
+
+ set ok 0
+ z callback {sort-response z.1}
+ z.1 sort "$query $flags"
+ vwait ok
+ return {}
+}
+