Display usage when no arguments supplied

This commit is contained in:
Lukáš Kucharczyk 2022-11-16 09:02:52 +01:00
parent c86f125ed3
commit 473d88b3c9
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
1 changed files with 4 additions and 1 deletions

5
tag.sh
View File

@ -22,7 +22,7 @@ SCRIPT_NAME=$(basename "$0")
DB_FILE="${PWD}/tags.db"
[ "$1" = "--db" ] && DB_FILE="$2" && shift 2
[ "${1:-}" = "--db" ] && DB_FILE="$2" && shift 2
DB_SCHEMA="${SCRIPT_DIR}/database.sql"
@ -166,6 +166,9 @@ add_path_auto() {
}
main() {
[ -z "${1:-}" ] && fail "Usage: tag init/add/import/autoimport/list/listtags"
if [[ "$1" = "init" ]]; then
init "${2:-$DB_FILE}"
exit 0