diff bin/rq @ 0:2aa53823fb21

new repo
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Sat, 06 Jun 2026 10:19:04 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/rq	Sat Jun 06 10:19:04 2026 +0100
@@ -0,0 +1,26 @@
+#!/bin/bash
+n=100
+while [ "x$1" != "x${1##-}" ]
+do
+ case $1 in
+ -s) shift; args="$args -S date -D" 
+     sort=1 # FIXME rq.py unsorts otherwise 
+     ;;
+ -S) shift; args="$args -s \"\"" ;;
+ -l) shift; less=1 ;;
+ -n) n=$2 ; shift ; shift ;;
+ -*) args="$args $1" ; shift ;;
+ *) echo usage: rq [-s] [-l] [-n n] [-...] query . . . ; exit 1 ;;
+ esac
+done
+args="$args -n $n"
+/usr/bin/recollq $args -q "$@" > /tmp/rqr$$
+#recoll $args -t -q "$@" > /tmp/rqr$$
+head -2 /tmp/rqr$$
+tail -n +3 /tmp/rqr$$ | if [ "$sort" -o "$less" ]
+then
+ rq.py "$sort" "$less"
+else
+ cat
+fi
+rm /tmp/rqr$$