feat: STATUS support
This commit is contained in:
@@ -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 }
|
||||
|
Reference in New Issue
Block a user