]> Sergey Matveev's repositories - dotfiles.git/commitdiff
rcl no will disable abstracts. Replace abstracts with snippets. Add less
authorSergey Matveev <stargrave@stargrave.org>
Thu, 16 Dec 2021 08:17:20 +0000 (11:17 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 27 Jan 2022 11:35:14 +0000 (14:35 +0300)
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