aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-04-10 11:15:10 +0800
committertypebrook <typebrook@gmail.com>2020-04-10 11:15:11 +0800
commitdbc2efa4a60af98045162d894519d5a09660d2d5 (patch)
tree32d08b368cadb9e115f9e19fe10513478614ee31
parentea0a9ccddc1855c0ace138ff258928faeac022f2 (diff)
Improve 'gist tag <tag-value>'
Use user put '.' as pattern, treat them as '[^ ]'
-rwxr-xr-xgist3
1 files changed, 2 insertions, 1 deletions
diff --git a/gist b/gist
index 2e75003..956d849 100755
--- a/gist
+++ b/gist
@@ -44,6 +44,7 @@
44# gist 3 (show the repo path of your 3rd gist, and do custom actions) 44# gist 3 (show the repo path of your 3rd gist, and do custom actions)
45# gist 3 --no-action (show the repo path of your 3rd gist, and do not perform actions) 45# gist 3 --no-action (show the repo path of your 3rd gist, and do not perform actions)
46# gist new --desc bar foo (create a new gist with files and description) 46# gist new --desc bar foo (create a new gist with files and description)
47# gist tag .+ (show tagged gists)
47# 48#
48# Since now a gist is a local cloned repo 49# Since now a gist is a local cloned repo
49# It is your business to do git commit and git push 50# It is your business to do git commit and git push
@@ -731,7 +732,7 @@ _tag_gist() {
731 (_edit_gist $1 "$new_desc" &>/dev/null &) 732 (_edit_gist $1 "$new_desc" &>/dev/null &)
732 # if user want to filter gists with given tags 733 # if user want to filter gists with given tags
733 else 734 else
734 local pattern="($(sed -E 's/([^ ]+)/#\1/g; s/ /[[:space:]]|/g' <<<"$@") )" 735 local pattern="($(sed -E 's/([^ ]+)/#\1/g; s/ /[[:space:]]|/g; s/\./[^ ]/g' <<<"$@") )"
735 hint=false mark=${INPUT:+.} display=tag _show_list | grep --color=always -E "$pattern" 736 hint=false mark=${INPUT:+.} display=tag _show_list | grep --color=always -E "$pattern"
736 fi 737 fi
737} 738}