From 159dae1e649665701a4777cbff59e9bc6ccfc44b Mon Sep 17 00:00:00 2001 From: typebrook Date: Mon, 16 Mar 2020 12:09:53 +0800 Subject: Add error message --- gist | 1 + 1 file changed, 1 insertion(+) diff --git a/gist b/gist index a57811d..439a60d 100755 --- a/gist +++ b/gist @@ -276,6 +276,7 @@ _show_list() { # TODO support filenames, file contents _grep_content() { + if [[ -z $1 ]]; then echo 'Please give a pattern' && return 1; fi while read -r index url _ _ _ _ _ _ description; do if grep --color=always -iq "$1" <<<"$description"; then hint=false mark="$index " _show_list | grep --color=always -Ei "$1" -- cgit v1.2.3-70-g09d2