HELP="
Adds a particpant to an event.
- event-participant [--help] [FILE]
+ event-participant [--help] [+NAME] [FILE]
Participant and date added are read from email on standard input. The
-record is mantained in FILE. Most common is to leav FILE out, then the
+record is mantained in FILE. Most common is to leave FILE out, then the
formermost record is reused.
+Add extra participants (email taken as From field) with
+argument +NAME.
+
If input is empty, also list of particiants is printed.
echo | event-participant
exit 0
fi
+if [[ "$1" =~ \+.* ]]; then
+ extra_name=${1#+}
+ shift
+fi
+
arg_event="$1"
if [ -f "$CACHE" ]; then
participant="$match"
fi
[[ "$info" =~ (Date: )([^:]*) ]]
+
+if [ -n "$extra_name" ]; then
+ participant="$extra_name $participant"
+fi
+
date=$(date -I -d "${BASH_REMATCH[2]}")
echo "${participant},${date}" |