feat: STATUS support
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
## src/awk/parse.awk
|
||||
## Parse iCalendar file and print its key aspects:
|
||||
## ```
|
||||
## <start> <end> <fpath> <collection> <summary>
|
||||
## <start> <end> <fpath> <collection> <status> <summary>
|
||||
## ```.
|
||||
##
|
||||
## @assign collection_labels: See configuration of the current program.
|
||||
@@ -72,7 +72,8 @@ function print_data(start, dur, end, summary, cmd, collection, depth, path) {
|
||||
cmd = "date -d '" end "' +\"%s\""
|
||||
cmd | getline end
|
||||
close(cmd)
|
||||
print start, end, fpath, collection, summary
|
||||
status = status ? status : "CONFIRMED"
|
||||
print start, end, fpath, collection, status, summary
|
||||
}
|
||||
|
||||
# AWK program
|
||||
@@ -89,6 +90,7 @@ BEGIN {
|
||||
/^DTSTART/ && inside { start = parse() }
|
||||
/^DTEND/ && inside { end = parse() }
|
||||
/^DURATION/ && inside { end = parse_duration($NF); dur = 1 }
|
||||
/^STATUS/ && inside { status = $NF }
|
||||
/^[^ ]/ && rs { rs = 0 }
|
||||
/^ / && rs { summary = summary substr($0, 2) }
|
||||
/^SUMMARY/ && inside { rs = 1; summary = $0 }
|
||||
|
Reference in New Issue
Block a user