diff options
| author | typebrook <typebrook@gmail.com> | 2020-03-26 15:33:03 +0800 |
|---|---|---|
| committer | typebrook <typebrook@gmail.com> | 2020-03-26 15:33:03 +0800 |
| commit | 93ae7d5204cf11d916c5f093bfcf70d9b89d0437 (patch) | |
| tree | 08f23ac115956760a1fe159f9cc9d689cd3e90c1 | |
| parent | a63c88600da750a5c17c89a7e45d215f5d429b75 (diff) | |
Reformat star list
| -rwxr-xr-x | gist | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -296,10 +296,10 @@ _show_list() { | |||
| 296 | | while read -r "${INDEX_FORMAT[@]}"; do | 296 | | while read -r "${INDEX_FORMAT[@]}"; do |
| 297 | local repo; repo=$folder/${url##*/} | 297 | local repo; repo=$folder/${url##*/} |
| 298 | local extra; extra=$(_check_repo_status "$repo" "$blob_code") | 298 | local extra; extra=$(_check_repo_status "$repo" "$blob_code") |
| 299 | [[ -z $extra ]] && extra="$file_num $comment_num" | 299 | [[ -z $extra ]] && extra="$(printf "%-4s" "$file_num $comment_num")" |
| 300 | [[ $index =~ ^s ]] && extra=$(printf "%-10s " $author)${extra} | ||
| 301 | local hashtags=$(_hashtags "$description") | 300 | local hashtags=$(_hashtags "$description") |
| 302 | local description=$(sed -E -e 's/^\[(.+)\]/\\e[33m[\1]\\e[0m/' <<<"$description" | sed "s/ $hashtags$//") | 301 | [[ $index =~ ^s ]] && description="$(printf "%-12s" [${author}]) ${description}" |
| 302 | description=$(sed -E -e 's/^\[(.+)\]/\\e[33m[\1]\\e[0m/' <<<"$description" | sed "s/ $hashtags$//") | ||
| 303 | [[ $tag == 'true' ]] && url="$hashtags" && local width=45 && align=' ' | 303 | [[ $tag == 'true' ]] && url="$hashtags" && local width=45 && align=' ' |
| 304 | 304 | ||
| 305 | raw_output="$(printf "% 3s" "$index") $(printf "%${align:--}${width:-56}s" "$url") $extra $description" | 305 | raw_output="$(printf "% 3s" "$index") $(printf "%${align:--}${width:-56}s" "$url") $extra $description" |