dotfiles/.local/scripts/todo

21 lines
333 B
Text
Raw Permalink Normal View History

2025-02-01 00:22:29 -05:00
#!/bin/bash
# REQUIRES:
# coreutils
# bash
# $HOME
# todo: simple todo script
todo_file="$HOME/.local/share/todo"
if [[ ! -f "$todo_file" ]]; then
touch "$todo_file"
fi
if [[ "$1" == "-r" ]]; then
sed -i -e "$(($2+1))d" "$todo_file"
elif (($#)); then
printf "%s\n" "$*" >> "$todo_file"
fi
nl -v 0 -w 2 -n 'ln' "$todo_file"