diff options
author | Guillermo Ramos | 2021-09-13 17:15:42 +0200 |
---|---|---|
committer | Guillermo Ramos | 2021-09-13 17:15:42 +0200 |
commit | bbc4a8a104ad939cc47f00d533e73eccf61213cc (patch) | |
tree | 2b588f901421e424f9a8376ba85d970cd6f73765 | |
parent | 413d00a40c43e6f7c6c92f363f71400e04b3d0f5 (diff) | |
download | cli-bbc4a8a104ad939cc47f00d533e73eccf61213cc.tar.gz |
gromo: sort status by total time
-rwxr-xr-x | gromo | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -88,7 +88,7 @@ cmd_status() { if [ -d "$TODAY_DIR" ]; then # needs nullglob for task_file in "$TODAY_DIR"/*; do - out=$( + out+=$( awk -F $FS -f - "$task_file" <<EOF { tasks[\$1][\$2] = \$3 } END { @@ -103,11 +103,12 @@ END { } EOF ) - - while IFS=$FS read -r task dur gromos; do - echo -e "$task\n\t$gromos gromos, $(pp_seconds $dur)" - done <<<"$out" + out+="\n" done + + while IFS=$FS read -r task dur gromos; do + echo -e "$task\n\t$gromos gromos, $(pp_seconds $dur)" + done <<<$(echo -e "$out" | sort -t $FS -k 2 -rn) fi fi } |