aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-03-18 11:54:51 +0800
committertypebrook <typebrook@gmail.com>2020-03-18 11:54:51 +0800
commit6262a78bea9417c8099d8774f2b8a27ee5406976 (patch)
tree813e78d55444d27de9111b6739ddd5c24eb60c24
parent1c4ff2d1688bd39742bf7565c45239aaf7e134e7 (diff)
Add definition for characters used in tag
-rwxr-xr-xgist3
1 files changed, 2 insertions, 1 deletions
diff --git a/gist b/gist
index c624def..1719520 100755
--- a/gist
+++ b/gist
@@ -50,6 +50,7 @@ GITHUB_API=https://api.github.com
50CONFIG=~/.config/gist.conf; mkdir -p ~/.config 50CONFIG=~/.config/gist.conf; mkdir -p ~/.config
51 51
52INDEX_FORMAT=('index' 'url' 'blob_code' 'file_num' 'comment_num' 'author' 'created_at' 'updated_at' 'description') 52INDEX_FORMAT=('index' 'url' 'blob_code' 'file_num' 'comment_num' 'author' 'created_at' 'updated_at' 'description')
53TAG_CHAR='-_[:alnum:]'
53 54
54[[ -z $hint ]] && hint=true # default to show hint with list of gist 55[[ -z $hint ]] && hint=true # default to show hint with list of gist
55[[ -z $confirm ]] && confirm=true # default to confirm when deleting gists 56[[ -z $confirm ]] && confirm=true # default to confirm when deleting gists
@@ -238,7 +239,7 @@ _apply_config() {
238 239
239# extract trailing hashtags from description 240# extract trailing hashtags from description
240_hashtags() { 241_hashtags() {
241 grep -Eo ' #[[:alnum:]\-\_ #]+$' <<<"$1" | sed -Ee 's/.* [[:alnum:]\-\_]+//g' | xargs 242 grep -Eo " #[$TAG_CHAR #]+$" <<<"$1" | sed -Ee "s/.* [$TAG_CHAR]+//g" | xargs
242} 243}
243 244
244# Return git status of a given repo 245# Return git status of a given repo