feat(imp2ics): add RFC 5545 DTEND, line folding, CSV export and deduplication

This commit is contained in:
2026-11-04 14:45:14 +01:00
parent d98abbb99d
commit 9bdcf860e6
2 changed files with 11 additions and 7 deletions
+10 -5
View File
@@ -1,10 +1,15 @@
#!/bin/bash
# Check if the first argument starts with [ and ends with ]
if [[ "$1" =~ ^\[.*\]$ ]]; then
CATEGORY="${1^^}" # Uppercase the tag
shift # Remove the category from the argument list
ARGS="$*" # The rest of the message
# Check if category tag is provided, e.g. [TAG] or "[TAG] message"
if [[ "$1" =~ ^\[([^]]+)\][[:space:]]*(.*)$ ]]; then
CATEGORY="${BASH_REMATCH[1]^^}"
REST="${BASH_REMATCH[2]}"
shift
if [ -n "$REST" ]; then
ARGS="$REST${*:+ }$*"
else
ARGS="$*"
fi
else
CATEGORY="GENERAL"
ARGS="$*"