Add function todo
This commit is contained in:
parent
2f11992488
commit
e25b37d0b6
22
libs/todo.bash
Normal file
22
libs/todo.bash
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
todo() {
|
||||
if [[ ! -f $HOME/.todo ]]; then
|
||||
touch $HOME/.todo
|
||||
fi
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
cat $HOME/.todo
|
||||
elif [[ "$1" == "-l" ]]; then
|
||||
cat -n $HOME/.todo
|
||||
elif [[ "$1" == "-c" ]]; then
|
||||
echo "" > $HOME/.todo
|
||||
elif [[ "$1" == "-r" ]]; then
|
||||
cat -n $HOME/.todo
|
||||
echo -ne "----------------------------\nType a number to remove: "
|
||||
read NUMBER
|
||||
sed -ie ${NUMBER}d $HOME/.todo
|
||||
else
|
||||
echo "$@" >> $HOME/.todo
|
||||
fi
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user