Adding ability to use todo with only arguments no flags

This commit is contained in:
Alex Epstein 2017-07-17 08:40:57 -04:00
parent 5a725c2e5d
commit 2cc2e7d79b
1 changed files with 3 additions and 2 deletions

View File

@ -101,6 +101,7 @@ removeTask()
rm -f ~/.todo/list.txt
cp ~/.todo/temp.txt ~/.todo/list.txt
rm -f ~/.todo/temp.txt
echo "Sucessfully removed task number $1"
}
getTasks()
@ -212,7 +213,7 @@ elif [[ $# == "1" ]];then
elif [[ $flag == "get" ]];then getTasks || exit 1
fi
else
if [[ $flag == "add" ]];then addTask "${*:2}" && getTasks|| exit 1
elif [[ $flag == "remove" ]];then removeTask $2 || exit 1
if [[ $flag == "add" || $1 == "add" ]];then addTask "${*:2}" && getTasks|| exit 1
elif [[ $flag == "remove" || $1 == "remove" ]];then removeTask $2 || exit 1
else usage;fi
fi