aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-03-17 00:22:19 +0800
committertypebrook <typebrook@gmail.com>2020-03-17 00:35:37 +0800
commit11c169ba0bc0836c138eb3890d9fbd9710e145ac (patch)
tree380e014400e0c33d024cdef9658f3bb7c6efd369
parentb4c42fcc59081b26243aa486290bf4f52f26e0ee (diff)
Add blink visuals to indicate valid indices
-rwxr-xr-xgist6
1 files changed, 3 insertions, 3 deletions
diff --git a/gist b/gist
index f3dd8a7..a593f27 100755
--- a/gist
+++ b/gist
@@ -422,10 +422,10 @@ _repo_url() {
422_gist_id() { 422_gist_id() {
423 GIST_ID=$( (grep -hs '' $INDEX || true) | sed -n -e "/^$1 / p" | cut -d' ' -f2 | sed -E -e 's#.*/##') 423 GIST_ID=$( (grep -hs '' $INDEX || true) | sed -n -e "/^$1 / p" | cut -d' ' -f2 | sed -E -e 's#.*/##')
424 if [[ -z $GIST_ID ]]; then 424 if [[ -z $GIST_ID ]]; then
425 echo -e "Not a valid index: \e[31m$1\e[0m" 425 echo -e "$(hint=false _show_list | sed -Ee 's/^( *[0-9a-z]+)/\\033[5m\1\\033[0m/')"
426 echo 'Use the index in the first column instead (like 1 or s1):'
427 echo 426 echo
428 hint=false _show_list 427 echo -e "Not a valid index: \e[33m$1\e[0m"
428 echo 'Use the indices blinking instead (like 1 or s1)'
429 return 1 429 return 1
430 fi 430 fi
431} 431}