From 93ae7d5204cf11d916c5f093bfcf70d9b89d0437 Mon Sep 17 00:00:00 2001 From: typebrook Date: Thu, 26 Mar 2020 15:33:03 +0800 Subject: Reformat star list --- gist | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gist b/gist index f7133b0..500097c 100755 --- a/gist +++ b/gist @@ -296,10 +296,10 @@ _show_list() { | while read -r "${INDEX_FORMAT[@]}"; do local repo; repo=$folder/${url##*/} local extra; extra=$(_check_repo_status "$repo" "$blob_code") - [[ -z $extra ]] && extra="$file_num $comment_num" - [[ $index =~ ^s ]] && extra=$(printf "%-10s " $author)${extra} + [[ -z $extra ]] && extra="$(printf "%-4s" "$file_num $comment_num")" local hashtags=$(_hashtags "$description") - local description=$(sed -E -e 's/^\[(.+)\]/\\e[33m[\1]\\e[0m/' <<<"$description" | sed "s/ $hashtags$//") + [[ $index =~ ^s ]] && description="$(printf "%-12s" [${author}]) ${description}" + description=$(sed -E -e 's/^\[(.+)\]/\\e[33m[\1]\\e[0m/' <<<"$description" | sed "s/ $hashtags$//") [[ $tag == 'true' ]] && url="$hashtags" && local width=45 && align=' ' raw_output="$(printf "% 3s" "$index") $(printf "%${align:--}${width:-56}s" "$url") $extra $description" -- cgit v1.2.3-70-g09d2