]> Sergey Matveev's repositories - dotfiles.git/blobdiff - recoll/bin/rcl
rcl no will disable abstracts. Replace abstracts with snippets. Add less
[dotfiles.git] / recoll / bin / rcl
index feae29325b93ea5e58d8ed1d676f39e4c1442be3..00440ad08c77ba875d3af166fa0350f6d533b5d6 100755 (executable)
@@ -1,18 +1,20 @@
 #!/bin/sh
 
+[ "$1" = "no" ] && shift || args="-A -p 2"
+
 cd ~/recoll
-idx="-c main"
+args="$args -c main"
 while : ; do
     [ -d "$1" ] || break
-    idx="$idx -i $1/xapiandb"
+    args="$args -i $1/xapiandb"
     shift
 done
 
-recollq $idx -A "$@" 2>/dev/null | perl -ne '
-    if (/^ABSTRACT/../^\/ABSTRACT/) {
-        print "\t$_" unless /^.?ABSTRACT/;
+recollq $args "$@" 2>/dev/null | perl -ne '
+    if (/^(ABSTRACT|SNIPPETS)/../^\/(ABSTRACT|SNIPPETS)/) {
+        print "\t$_" unless /^.?(ABSTRACT|SNIPPETS)/;
         next;
     };
     next unless /^(.*)\t\[file:\/\/(.*)\]\t\[.*\]\t\d+\t.*\t.*$/;
     print "$2\t$1\n";
-' | spc -e grn,"(^/.*)"
+' | spc -e grn,"(^/.*)" | less