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