hlfw.ca

task

Download patch

ref: f28653cf7b83b581d53232eb4801a9f98d9ec0b1
parent: c9cdd2ed16e9cc218a675addc421e2c59b8f1528
author: Michael Misch <michaelmisch1985@gmail.com>
date: Wed Aug 28 23:34:34 PDT 2024

Add example, prep for multi-project as well

--- a/README.md
+++ b/README.md
@@ -18,8 +18,7 @@
 
 `pro/rm` removes a given completed task. With `-f`, all matching tags are removed. With `-a`, all completed tags are checked for removal. 
 
-`pro/walk` shows the status of tasks in the graph. It prints a list of tasks prefixed with the status character.
-The -q option suppresses all output. The -f option filters tasks by status, and only patching items are printed. By default, the filters are DNS.
+`pro/walk` shows the status of tasks in the graph. It prints a list of tasks prefixed with the status character. The -c flag disables printing the status characters. The -p flag will only search within the given project. The -q option suppresses all output. The -f option filters tasks by status, and only matching items are printed. By default, the filters are DNS.
 
 The task status characters are as follows:
 
@@ -34,4 +33,8 @@
 ## TODO
 
 - `pro/walk` implementation
-- multi-project awareness for all utils. A task should be able to reference another project via a tag, such as `projectname:tag`
+- multi-project awareness for all utils. A task should be able to reference another project via a tag, such as `projectname/tag`
+
+## Multi-project thoughs
+
+A `pro/fs` could be spun up, given a set of paths that your projects live somewhere within, by default the user $home, and could walk the paths looking for .pro directories.
--- /dev/null
+++ b/example/.pro/config
@@ -1,0 +1,3 @@
+[project "pro"]
+	name=ns.pro
+	stubs=docs,bars
--- /dev/null
+++ b/example/.pro/ns
@@ -1,0 +1,3 @@
+mount /srv/plumb /mnt/plumb
+
+. /usr/glenda/lib/doc.namespace.9c
--- /dev/null
+++ b/example/.pro/task/0
@@ -1,0 +1,6 @@
+# tag: 0 after: otherproject/2
+#
+
+[ ] Item 1
+[ ] Item 2
+[x] Item 3
--- /dev/null
+++ b/example/.pro/task/1
@@ -1,0 +1,7 @@
+# tag: 1 before: 1
+#
+
+[ ] Item 1
+[ ] Item 2
+[ ] Third thing
+
--- a/rm
+++ b/rm
@@ -5,8 +5,11 @@
 	if(! ~ $#all 0){
 		if(! ~ $#force 0)
 			rmlist=`{ls .pro/task}
-		if not
+		if not {
+			# TODO: This will need to be filtered to just our project after
+			#rmlist=`{pro/walk -c -fC -p $project}
 			rmlist=`{pro/walk -c -fC}
+		}
 	}
 	if not {
 		if(! ~ $#force 0)
@@ -17,8 +20,12 @@
 }
 
 fn rmtask {
-	for(m in $rmlist)
+	for(m in $rmlist){
+		# TODO: when we have multiproject
+		#echo removed $project:$m
+		echo removed $m
 		rm $m
+	}
 }
 
 flagfmt='f:force, a:all'; args='tag'
--- a/task
+++ b/task
@@ -49,8 +49,10 @@
 		tag=$#files
 }
 
-fn final{
+fn finish{
 	cp $msgfile .pro/task/$tag
+	# TODO: . common.rc to set $project, as it's useful for our outputs
+	#echo '$project:$tag'
 }
 
 fn sigexit{
@@ -75,6 +77,6 @@
 	flag e +
 	gettag
 	editmsg
-	final
+	finish
 } || echo 'could not write task:' $status >[1=2]
 exit ''