feat: STATUS support

This commit is contained in:
2025-06-16 15:07:58 +02:00
parent 9e2e3bc35b
commit 1093bc15e5
6 changed files with 123 additions and 22 deletions

View File

@@ -22,12 +22,21 @@ function escape(str)
# AWK program
BEGIN { FS = "[:;]" }
BEGIN { FS = "[:;]"; zulu = strftime("%Y%m%dT%H%M%SZ", systime(), 1) }
/^BEGIN:VEVENT$/ { inside = 1 }
/^END:VEVENT$/ { inside = 0; if (!duplic) print field ":" escape(value) }
/^END:VEVENT$/ {
inside = 0
if (!duplic)
print field ":" escape(value)
seq = seq ? seq + 1 : 1
print "SEQUENCE:" seq
print "LAST-MODIFIED:" zulu
}
$1 == field && inside { con = 1; duplic = 1; print field ":" escape(value); next }
$1 == field && duplic { con = 1; next }
/^ / && con { next }
/^ / && con { next }
/^[^ ]/ && con { con = 0 }
/^SEQUENCE/ && inside { seq = $2; next } # store sequence number and skip
/^LAST-MODIFIED/ && inside { next }
{ print }