From 473d88b3c9fb30a140b9d41f85d37877e93e9812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Wed, 16 Nov 2022 09:02:52 +0100 Subject: [PATCH] Display usage when no arguments supplied --- tag.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tag.sh b/tag.sh index e6bde3c..05e4979 100755 --- a/tag.sh +++ b/tag.sh @@ -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