From b7e13d649d5eb5bc9f1717a33b88fcb9267712c7 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 11 May 2020 16:52:51 +0200 Subject: [PATCH] [sh] Add wording argument to exist script Added optional third argument to exist script which can be used to identify the program or process that needs the command exist looks for. This makes it easier to identify *who* called exist and is missing something. --- sh/.local/bin/exist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sh/.local/bin/exist b/sh/.local/bin/exist index 0968e01..e3aa67f 100755 --- a/sh/.local/bin/exist +++ b/sh/.local/bin/exist @@ -8,9 +8,9 @@ if command -v "$1" >/dev/null; then else if [ -n "$2" ]; then if command -v notify-send >/dev/null; then - notify-send "📦 $1" --urgency="$2" "must be installed for this function." + notify-send "📦 $1" --urgency="$2" "must be installed for ${3:-"this"} function." fi - printf "%s: 📦 %s must be installed for this function.\n" "$2" "$1" + printf "%s: 📦 %s must be installed for %s function.\n" "$2" "$1" "${3:-"this"}" fi exit 1 fi