From 11c169ba0bc0836c138eb3890d9fbd9710e145ac Mon Sep 17 00:00:00 2001 From: typebrook Date: Tue, 17 Mar 2020 00:22:19 +0800 Subject: Add blink visuals to indicate valid indices --- gist | 6 +++--- 1 file 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() { _gist_id() { GIST_ID=$( (grep -hs '' $INDEX || true) | sed -n -e "/^$1 / p" | cut -d' ' -f2 | sed -E -e 's#.*/##') if [[ -z $GIST_ID ]]; then - echo -e "Not a valid index: \e[31m$1\e[0m" - echo 'Use the index in the first column instead (like 1 or s1):' + echo -e "$(hint=false _show_list | sed -Ee 's/^( *[0-9a-z]+)/\\033[5m\1\\033[0m/')" echo - hint=false _show_list + echo -e "Not a valid index: \e[33m$1\e[0m" + echo 'Use the indices blinking instead (like 1 or s1)' return 1 fi } -- cgit v1.2.3-70-g09d2