diff options
author | typebrook <typebrook@gmail.com> | 2020-03-16 12:09:53 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-03-16 12:09:53 +0800 |
commit | 159dae1e649665701a4777cbff59e9bc6ccfc44b (patch) | |
tree | 9bd039d2e45d75de2fd659e9920ef55420b21628 | |
parent | 6acb5616e69d441f19193f80973db3a27d3ab4bb (diff) |
Add error message
-rwxr-xr-x | gist | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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" |