Skip to content

Commit

Permalink
Fixed "tomb search" for real
Browse files Browse the repository at this point in the history
Makes `tomb search` work as expected.
`tomb search tombname pattern` will search `pattern` in `tombname`.
  • Loading branch information
gdrooid committed May 31, 2013
1 parent 778bca3 commit d4b5d65
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tomb
Original file line number Diff line number Diff line change
Expand Up @@ -1537,19 +1537,20 @@ 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]}`
tombname=${t[(ws:;:)5]}
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"
Expand Down

0 comments on commit d4b5d65

Please sign in to comment.