Wednesday, December 20, 2006

Searchable Tags in td

I'm starting to really like writing console apps in Python. To add a feature takes no time at all since there is little UI to deal with. Over the last hour I've implemented tagging for your tasks in td. Tags for searching and grouping items seem to be pretty popular in current applications, so I thought why not a todo list manager? I think I like this better than the projects I implemented a couple of weeks ago. The projects stuff is of course still available and fully functional, I just don't think I'll be using it as much anymore because the new tags are much handier. In fact, you can still use both at the same time. Here is how the new tags command works...

When you create a new task, a group of tags can be associated with it by including a space separated list, enclosed in square brackets, in the task summary.

$ td add [tag1 tag2 tag3]This is a new task.

Now, if I want to see what tags are being used:

$ td tags
--> Available tags:
--> tag1(1) tag2(1) tag3(1)

Issuing the new tags command with no arguments lists all tags, and the number of tasks with that tag. If you want to see a list of tasks by tag:

$ td tags tag1
-->  #   P H  Created    Description
-->  1        12/20/06   This is a new task.

Maybe you want to see a list of tags that are associated with a specific task?

$ td tags 1
--> [tag1 tag2 tag3]

Want to remove the "tag2" tag from that task? No problem...

$ td tags 1 -tag2
$ td tags 1
--> [tag1 tag3]

Let's remove "tag3" now, and add "newtag" to this task:

$ td tags 1 -tag3 +newtag
$ td tags 1
--> [tag1 newtag]

You can still use the replace command to replace all of them at once.

$ td replace 1 [foo bar]This is a new task.
$ td tags 1
--> [foo bar]

And of course you can easily combine hidden status, tags, and projects all at once.

$ td add .[tag1 tag2] p:MyProject This is yet another new task.
$ td tags tag1
-->  #   P H  Created    Description
-->  2     *  12/20/06   This is yet another new task.
$ td project MyProject
-->  #   P H  Created    Description
-->  2     *  12/20/06   This is yet another new task.

Notice the "H" column in that output indicates whether the task in the list is hidden or not. That column was recently added to both the tags and the project output. These changes are committed and pushed to the bazaar repository that I spoke of in my last post. Don't forget to email me the bugs!

No comments:

Post a Comment