diff options
author | typebrook <typebrook@gmail.com> | 2020-05-26 14:09:04 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-05-26 14:09:04 +0800 |
commit | 3fe2c36c153b22c79effc7122fb8b5c6564c2880 (patch) | |
tree | 2215091b7001a89a788fbcfdc892318fd36277fa | |
parent | 7e185dd11ee13727aa86c32583a2712aca001b92 (diff) |
Add index to the result of user query
-rwxr-xr-x | gist | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -452,9 +452,9 @@ _update_gists() { | |||
452 | _query_user() { | 452 | _query_user() { |
453 | local fetched_records=$(tmp_file fetched) | 453 | local fetched_records=$(tmp_file fetched) |
454 | route=users/$1/gists _fetch_gists_with_pagnation $fetched_records | 454 | route=users/$1/gists _fetch_gists_with_pagnation $fetched_records |
455 | cat $fetched_records \ | 455 | tac <$fetched_records | nl -s' ' \ |
456 | | while read -r ${INDEX_FORMAT[@]#index}; do | 456 | | while read -r ${INDEX_FORMAT[@]}; do |
457 | echo "$url $author $file_num $comment_num $description" | cut -c -"$(tput cols)" | 457 | echo $index $url $author $file_num $comment_num $description | cut -c -"$(tput cols)" |
458 | done || { echo "Failed to query $1's gists"; exit 1; } | 458 | done || { echo "Failed to query $1's gists"; exit 1; } |
459 | } | 459 | } |
460 | 460 | ||