Compare commits

..

4 Commits

1 changed files with 7 additions and 2 deletions

9
tag.sh
View File

@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -ueo pipefail
[ "${DEBUG:-0}" = "1" ] && set -x
# usage:
# - init - create an empty database
# - import - import $FILE or import $DIR, both can be multiple values
@ -12,12 +13,16 @@ set -ueo pipefail
# - tag $FILENAME $TAG - tag $FILENAME with $TAG, $TAG can be repeated
# - listtags $FILENAME - list all tags for $FILENAME
# TODO: when tagging, check if tags exist
# TODO: when tagging, allow more than one tag
# FIXME: adding tags doesn't work
SCRIPT_DIR=$(dirname $(readlink "$0"))
DB_FILE="tags.db"
DB_SCHEMA="database.sql"
DB_SCHEMA="${SCRIPT_DIR}/database.sql"
declare -A FILTERS
FILTERS[video]="avi|flv|mkv|mov|mp4|mpg|ogv|webm|wmv"
[ "${DEBUG:-0}" = "1" ] && set -x
fail() {
echo "$1" >&2;