mirror of
https://github.com/olexsmir/dotfiles.git
synced 2026-01-15 08:41:34 +02:00
16 lines
438 B
Bash
Executable file
16 lines
438 B
Bash
Executable file
#!/usr/bin/env bash
|
|
action=$1
|
|
shift
|
|
|
|
CONTEXTS=$(grep -o '[^ ]*@[^ ]\+' "$TODO_FILE" | grep '^@' | sort -u | sed 's/^@//g' )
|
|
for context in $CONTEXTS ; do
|
|
if [[ $context == "someday" ]]; then
|
|
continue
|
|
fi
|
|
|
|
CONTEXT_LIST=$(_list "$TODO_FILE" "@$context\b" "$@" | sed 's/\ *@[a-zA-Z0-9._\-]*\ */ /g')
|
|
if [[ -n "${CONTEXT_LIST}" ]]; then
|
|
echo -e "--@${context}"
|
|
echo "${CONTEXT_LIST}" | eval $TODOTXT_FINAL_FILTER
|
|
fi
|
|
done
|