Samstag, 28. Januar 2012

Todo List in a Nut Shell

Update: Now just type todo to see your todo list. The old -s Option is still there. I also fixed a Bug which causes the marking more than one line to fail when you use the last line of your todo list as the last argument or rather specific when you use the n-1 last lines of n marked entries as arguments. Thanks to my friend sebastian who gave the crucial hint for fixing that issue.

I fixed some bugs in the script. Entries which are marked as done are moved to the bottom of the $TODO_LIST_FILE. The Script checks if arguments to -u or -x or -m are valid integers and if these lines really exists in the $TODO_LIST_FILE. It should now be impossible to give line 23 as argument when such line does not exist. The Script will exit with exit status 1 if one of the arguments is not valid. This feature will give you more protection from destroying your todolist.
Some rather minor options; the -B Option (backup your todolist) and the -R (restore your todolist from backup); have been added.

I spend a little time in the train to implement new features in the Script.
1) With -m (modify) you are able to edit or correct entries. You need read and gawk
to get this working.
2) With -p you are clearing the todo list. All(!) Entries getting lost. And with -pp you even remove

The newest version does'nt need a new entry enclosed in "". I fixed this issue on weekends.

You also can unmark and mark more than one entry at a time. Just list them as arguments separated by spaces.

Hi girls and guys,

on weekend i have had a little bit time to clean up my github repository and work on new scripts. so i manged beginning one of my most usefull scripts.

When i had the idea i was writing my things i had to do in a simple textfile using the editor of my choice (vim). so i was wondering whether i could maintain a simple todo list on my machine without having firing up an editor every time. So i came up with the idea to write a small script using sed and grep which would accomplish this task.

Simply download the script or clone my github repository. I recommend putitng the script to /usr/local/bin and link the script to /usr/local/bin/todo.

And this is how it works: You simply add a new entry to your todo list by typing:

-a My new task

Since you don't have a file for your todo list yet you will be asked creating a new one. This is just my way of doing things, because i think that no actions should be taken without the user knowing whats going on.

More entries can be added the same way:

todo -a just an other task
todo -a oh no not again

You now have three open tasks in your todo list which can be seen by typing:

todo -s

1 new task --> [o]
2 just an other taks --> [o]
3 oh no not again --> [o]

if you have finished one task you can mark this particular task as being done using the line number and the -x option:

todo -x 2

You can reveal this by using the -s option again:

todo -s

1 new task --> [o]
2 just an other taks --> [x]
3 oh no not again --> [o]

--> [x]
indicates for you that the task with line #2 has been marked as one you managed to finish.

You can inspect only those tasks which are open by using the -o option and those which you have marked as being done by using the -d option.

Lets say the task has come available again and you need to do this task again. You can readd this task to your open task by using the -u #N option, where the parameter #N is the number of the line you want to readd.

And finaly todo -r clears all (!) task you have marked as finished.

Although i will improve this script and will add more features it works pretty well in this early stage and i welcome you to comment and improve my work.

that's all folks

Keine Kommentare:

Kommentar veröffentlichen

Hinweis: Nur ein Mitglied dieses Blogs kann Kommentare posten.