summaryrefslogtreecommitdiff
path: root/2005/d/dev/todo/tasklist.pl
diff options
context:
space:
mode:
Diffstat (limited to '2005/d/dev/todo/tasklist.pl')
-rwxr-xr-x2005/d/dev/todo/tasklist.pl16
1 files changed, 14 insertions, 2 deletions
diff --git a/2005/d/dev/todo/tasklist.pl b/2005/d/dev/todo/tasklist.pl
index 5e9aaba..a08f32d 100755
--- a/2005/d/dev/todo/tasklist.pl
+++ b/2005/d/dev/todo/tasklist.pl
@@ -33,6 +33,7 @@ sub build_tab
while (<>)
{
chomp;
+ s/^[ \t]+//;
if (!defined $lastdesc && /^([a-z0-9](?:\.[a-z0-9.]+)*) (.*)/)
{
# Task.
@@ -67,7 +68,7 @@ sub build_tab
{
die "Task not defined" unless defined $task;
$$task{'desc'} = [ ] unless defined $$task{'desc'};
- if (defined $lastdesc)
+ if (defined $lastdesc && !/^[+-]/)
{
$$lastdesc .= ' ' . $_;
}
@@ -95,7 +96,18 @@ sub print_task_xml
}
for (@{$$task{'desc'}})
{
- print "$space <desc>$_</desc>\n";
+ if (/^\+ /)
+ {
+ print "$space <desc status=\"done\">$_</desc>\n";
+ }
+ elsif (/^- /)
+ {
+ print "$space <desc status=\"todo\">$_</desc>\n";
+ }
+ else
+ {
+ print "$space <desc>$_</desc>\n";
+ }
}
for (sort { $a <=> $b || $a cmp $b } keys %$task)
{