aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-03-16 12:09:53 +0800
committertypebrook <typebrook@gmail.com>2020-03-16 12:09:53 +0800
commit159dae1e649665701a4777cbff59e9bc6ccfc44b (patch)
tree9bd039d2e45d75de2fd659e9920ef55420b21628
parent6acb5616e69d441f19193f80973db3a27d3ab4bb (diff)
Add error message
-rwxr-xr-xgist1
1 files changed, 1 insertions, 0 deletions
diff --git a/gist b/gist
index a57811d..439a60d 100755
--- a/gist
+++ b/gist
@@ -276,6 +276,7 @@ _show_list() {
276 276
277# TODO support filenames, file contents 277# TODO support filenames, file contents
278_grep_content() { 278_grep_content() {
279 if [[ -z $1 ]]; then echo 'Please give a pattern' && return 1; fi
279 while read -r index url _ _ _ _ _ _ description; do 280 while read -r index url _ _ _ _ _ _ description; do
280 if grep --color=always -iq "$1" <<<"$description"; then 281 if grep --color=always -iq "$1" <<<"$description"; then
281 hint=false mark="$index " _show_list | grep --color=always -Ei "$1" 282 hint=false mark="$index " _show_list | grep --color=always -Ei "$1"