aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-05-26 14:09:04 +0800
committertypebrook <typebrook@gmail.com>2020-05-26 14:09:04 +0800
commit3fe2c36c153b22c79effc7122fb8b5c6564c2880 (patch)
tree2215091b7001a89a788fbcfdc892318fd36277fa
parent7e185dd11ee13727aa86c32583a2712aca001b92 (diff)
Add index to the result of user query
-rwxr-xr-xgist6
1 files changed, 3 insertions, 3 deletions
diff --git a/gist b/gist
index b87da54..d21655c 100755
--- a/gist
+++ b/gist
@@ -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