From 778bca386426c7cb402aabc27fb0c1156c5093df Mon Sep 17 00:00:00 2001 From: gdrooid Date: Thu, 30 May 2013 20:24:51 +0200 Subject: [PATCH 1/2] Fixed "tomb search" This way you can't specify a tomb to search in, but at least it will search for the patterns. --- tomb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tomb b/tomb index cf74546e..cce9ce03 100755 --- a/tomb +++ b/tomb @@ -1537,7 +1537,7 @@ search_tombs() { die "Cannot index tombs on this system: updatedb not installed" } # list all open tombs - mounted_tombs=(`list_tomb_mounts $1`) + mounted_tombs=(`list_tomb_mounts`) { test ${#mounted_tombs} = 0 } && { die "I can't see any open tomb, may they all rest in peace." } yes "Searching for: $fg_bold[white]${=PARAM}$fg_no_bold[white]" From d4b5d652f5172cec6604adf486546e00f6a8868b Mon Sep 17 00:00:00 2001 From: gdrooid Date: Fri, 31 May 2013 14:18:20 +0300 Subject: [PATCH 2/2] Fixed "tomb search" for real Makes `tomb search` work as expected. `tomb search tombname pattern` will search `pattern` in `tombname`. --- tomb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tomb b/tomb index cce9ce03..3d61725d 100755 --- a/tomb +++ b/tomb @@ -1537,10 +1537,11 @@ search_tombs() { die "Cannot index tombs on this system: updatedb not installed" } # list all open tombs - mounted_tombs=(`list_tomb_mounts`) + mounted_tombs=(`list_tomb_mounts $1`) { test ${#mounted_tombs} = 0 } && { die "I can't see any open tomb, may they all rest in peace." } - yes "Searching for: $fg_bold[white]${=PARAM}$fg_no_bold[white]" + shift + yes "Searching for: $fg_bold[white]${=@}$fg_no_bold[white]" for t in ${mounted_tombs}; do xxx "checking for index: ${t}" mapper=`basename ${t[(ws:;:)1]}` @@ -1548,8 +1549,8 @@ search_tombs() { tombmount=${t[(ws:;:)2]} if [ -r ${tombmount}/.updatedb ]; then say "Searching in tomb $tombname" - locate -d ${tombmount}/.updatedb -e -i ${=PARAM} - say "Matches found: `locate -d ${tombmount}/.updatedb -e -i -c ${=PARAM}`" + locate -d ${tombmount}/.updatedb -e -i ${=@} + say "Matches found: `locate -d ${tombmount}/.updatedb -e -i -c ${=@}`" else no "skipping tomb $tombname: not indexed" no "run 'tomb index' to create indexes"