feat(user/malte): note script, show what I did today
This commit is contained in:
parent
ea02091bfd
commit
62483472b5
|
@ -29,6 +29,8 @@ function print_help_and_exit() {
|
|||
printf "Arguments:\n"
|
||||
printf " todo | todos [TAG]\n"
|
||||
printf " Show only todos, optionally filtered by #TAG\n"
|
||||
printf " done | did\n"
|
||||
printf " Show only todos that I did today\n"
|
||||
printf " day | today\n"
|
||||
printf " Show only todays entry\n"
|
||||
printf " -1 | -2 | -3\n"
|
||||
|
@ -37,6 +39,7 @@ function print_help_and_exit() {
|
|||
}
|
||||
|
||||
ONLY_TODOS=
|
||||
ONLY_DONE=
|
||||
ONLY_DAY=
|
||||
FILTER_TAG=
|
||||
|
||||
|
@ -50,6 +53,11 @@ while [[ $# -gt 0 ]]; do
|
|||
shift
|
||||
fi
|
||||
;;
|
||||
done | did)
|
||||
ONLY_TODOS=1
|
||||
ONLY_DONE=1
|
||||
shift # past argument
|
||||
;;
|
||||
day | today)
|
||||
ONLY_DAY=today
|
||||
shift # past argument
|
||||
|
@ -80,6 +88,13 @@ bat "$XDG_DATA_HOME/life.md/$year.md" |
|
|||
else
|
||||
cat
|
||||
fi
|
||||
} |
|
||||
{
|
||||
if [ -n "$ONLY_DONE" ]; then
|
||||
rg "^- \[[xX]\] " | rg "done:$(date +%Y-%m-%d)"
|
||||
else
|
||||
cat
|
||||
fi
|
||||
}
|
||||
elif [ -n "$ONLY_DAY" ]; then
|
||||
rg --multiline --multiline-dotall "# $(date -d "$ONLY_DAY" +%Y-%m-%d)(.*?\n#[^#]|.*)"
|
||||
|
|
Loading…
Reference in a new issue