Add listbyfile option

This commit is contained in:
Lukáš Kucharczyk 2022-11-19 00:08:54 +01:00
parent 27f6db5410
commit 55388fea39
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
1 changed files with 5 additions and 0 deletions

5
tag.sh
View File

@ -345,6 +345,11 @@ main() {
listtags "$2"
exit 0
fi
if [[ "$1" = "listbyfile" ]]; then
sqlite_query "SELECT id,filename FROM files" |\
fzf --delimiter="|" --preview "sqlite3 $DB_FILE 'SELECT label FROM tags WHERE id IN (SELECT tid FROM tags_ties WHERE fid ={2})'"
fi
}
main "$@"