hlfw.ca

task

Download patch

ref: 3aed440807d578c3fab5bc705864ac4c2650800f
parent: e026625830c18a358a485d7c34002d3f853cac55
author: Michael Misch <michaelmisch1985@gmail.com>
date: Thu Aug 29 01:20:51 PDT 2024

Change from before and after, to child and parent for relational clarity

--- a/example/.pro/task/0
+++ b/example/.pro/task/0
@@ -1,4 +1,4 @@
-# tag: 0 after: otherproject/2
+# tag: 0 child: otherproject/2
 #
 
 [ ] Item 1
--- a/example/.pro/task/1
+++ b/example/.pro/task/1
@@ -1,4 +1,4 @@
-# tag: 1 before: 1
+# tag: 1 parent: example/0
 #
 
 [ ] Item 1
--- a/show
+++ b/show
@@ -22,18 +22,18 @@
 		split(content, parts, " ")
 
 		tag = ""
-		after = ""
-		before = ""
+		child = ""
+		parent = ""
 
 		for (i=1; i<=length(parts); i++) {
 			if (parts[i] == "tag:") tag = parts[i+1]
-			if (parts[i] == "after:") after = parts[i+1]
-			if (parts[i] == "before:") before = parts[i+1]
+			if (parts[i] == "child:") child = parts[i+1]
+			if (parts[i] == "parent:") parent = parts[i+1]
 		}
 
 		printf("tag: %s", tag)
-		if(before != "") printf(", before: %s", before)
-		if(after != "") printf(", after: %s", after)
+		if(bparent != "") printf(", parent: %s", parent)
+		if(child != "") printf(", child: %s", child)
 		print "\n"
 	}
 
@@ -60,10 +60,9 @@
 		if not
 			cat $m | pretty
 	}
-	# percentages
+	# TODO: Show child percentages
 }
 
-# Just pretty print a task, nothing to it
 flagfmt='r:raw'; args='[tags ...]'
 eval `''{aux/getflags $*} || exec aux/usage
 showlist=()
--- a/task
+++ b/task
@@ -5,10 +5,10 @@
 	if(! test -s $msgfile.tmp){
 		>$msgfile.tmp {
 			echo -n '# tag:' $tag
-			if(! ~ $#before 0)
-				echo -n ' before:' $before
-			if(! ~ $#after 0)
-				echo -n ' after:' $after
+			if(! ~ $#child 0)
+				echo -n ' child:' $child
+			if(! ~ $#parent 0)
+				echo -n ' parent:' $parent
 			echo ''
 			echo $data
 		}
@@ -40,7 +40,7 @@
 		rm -f $msgfile.tmp
 }
 
-flagfmt='c:change change, a:after after, b:before before, e:edit'; args='[msg ...]'
+flagfmt='c:change change, a:child child, b:parent parent, e:edit'; args='[msg ...]'
 eval `''{aux/getflags $*} || exec aux/usage
 
 msgfile=/tmp/pro-msg.$pid