From 7f06b56775575c5c678bab2a1a99c8c4d0a8e662 Mon Sep 17 00:00:00 2001 From: Chris Down Date: Sun, 22 Apr 2018 10:17:49 +0100 Subject: [PATCH] clipdel: Give more helpful message if we didn't provide a pattern --- clipdel | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clipdel b/clipdel index ebdc51b..ea4e19c 100755 --- a/clipdel +++ b/clipdel @@ -44,6 +44,11 @@ fi raw_pattern=${@: -1} esc_pattern=${raw_pattern/\#/'\#'} +if ! [[ $raw_pattern ]]; then + printf '%s\n' 'No pattern provided, see --help' >&2 + exit 2 +fi + exec {lock_fd}> "$lock_file" if (( CM_REAL_DELETE )) && [[ "$raw_pattern" == ".*" ]]; then