From 3be93d8e978b7ac70ef5700a7c1d7ca4bb020be0 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Thu, 29 Aug 2024 00:51:10 -0700 Subject: [PATCH] container: plugins: finance: timew_to_timeclock: print all tags --- .../plugins/finance/timew_to_timeclock.bash | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/container/plugins/finance/timew_to_timeclock.bash b/container/plugins/finance/timew_to_timeclock.bash index cd7cced..edddea0 100755 --- a/container/plugins/finance/timew_to_timeclock.bash +++ b/container/plugins/finance/timew_to_timeclock.bash @@ -100,12 +100,24 @@ function main() break default: # All others are considered "real" tags - tags=substr($0, 5) - sub(/=/, ":", tags) # Reconstruct to hledger tag format - # TODO: push to an array for more tags + tag=substr($0, 5) + + # Reconstruct to hledger tag format + sub(/=/, ":", tag) + tags[tag]=tag ", " + break } - } END { printf " " account " " description " ; " comment ", id:" _id ", " tags "\n"}' + } + END { + printf " " account " " description " ; " comment ", id:" _id ", " + for (t in tags) + { + i++ + printf t ", " + } + printf "\n" + }' __format_time "o" "$_end" echo done