diff options
| author | typebrook <typebrook@gmail.com> | 2020-03-18 11:54:51 +0800 |
|---|---|---|
| committer | typebrook <typebrook@gmail.com> | 2020-03-18 11:54:51 +0800 |
| commit | 6262a78bea9417c8099d8774f2b8a27ee5406976 (patch) | |
| tree | 813e78d55444d27de9111b6739ddd5c24eb60c24 | |
| parent | 1c4ff2d1688bd39742bf7565c45239aaf7e134e7 (diff) | |
Add definition for characters used in tag
| -rwxr-xr-x | gist | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -50,6 +50,7 @@ GITHUB_API=https://api.github.com | |||
| 50 | CONFIG=~/.config/gist.conf; mkdir -p ~/.config | 50 | CONFIG=~/.config/gist.conf; mkdir -p ~/.config |
| 51 | 51 | ||
| 52 | INDEX_FORMAT=('index' 'url' 'blob_code' 'file_num' 'comment_num' 'author' 'created_at' 'updated_at' 'description') | 52 | INDEX_FORMAT=('index' 'url' 'blob_code' 'file_num' 'comment_num' 'author' 'created_at' 'updated_at' 'description') |
| 53 | TAG_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 |