hlfw.ca

task

Download patch

ref: c9cdd2ed16e9cc218a675addc421e2c59b8f1528
parent: 09c2fc351115c87390601cb39f5cd480b24e555a
author: Michael Misch <michaelmisch1985@gmail.com>
date: Wed Aug 28 23:10:27 PDT 2024

Use task instead of todo

--- a/init
+++ b/init
@@ -10,7 +10,7 @@
 }
 
 name=`{basename `{cleanname -d `{pwd} $dir}}
-mkdir -p $dir/.pro/todo
+mkdir -p $dir/.pro/task
 
 touch $dir/.pro/ns
 >$dir/.pro/config {
--- a/mkfile
+++ b/mkfile
@@ -3,11 +3,12 @@
 BIN=/$objtype/bin/proj
 TARG=\
 	ns\
-	todo\
 
 RC=\
 	init\
-	add\
+	task\
+	rm\
+	walk\
 
 OFILES=\
 	conf.$O\
--- a/rm
+++ b/rm
@@ -4,15 +4,15 @@
 fn checkstate {
 	if(! ~ $#all 0){
 		if(! ~ $#force 0)
-			rmlist=`{ls .pro/todo}
+			rmlist=`{ls .pro/task}
 		if not
 			rmlist=`{pro/walk -c -fC}
 	}
 	if not {
 		if(! ~ $#force 0)
-			rmlist=`{ls .pro/todo/$tag}
+			rmlist=`{ls .pro/task/$tag}
 		if not
-			rmlist=`{pro/walk -q fC $tag && ls .pro/todo/$tag}
+			rmlist=`{pro/walk -q fC $tag && ls .pro/task/$tag}
 	}
 }
 
--- /dev/null
+++ b/show
@@ -1,0 +1,34 @@
+#!/bin/rc -e
+rfork ne
+
+fn gettags {
+	# Push to showlist
+	for(a in $*)
+		if(test -s .pro/task/$a)
+			showlist=($showlist $a)
+}
+
+fn pretty {
+
+}
+
+fn showtask {
+	for(m in $showlist){
+		if (~ $#raw 1)
+			cat $m
+		if not
+			pretty $m
+		}
+}
+
+# Just pretty print a task, nothing to it
+flagfmt='r:raw'; args='[tags ...]'
+eval `''{aux/getflags $*} || exec aux/usage
+
+showlist=()
+
+@{
+	gettags
+	showtask
+} || echo 'unable to show given tags:' $status >[1=2]
+exit ''
--- a/task
+++ b/task
@@ -42,7 +42,7 @@
 }
 
 fn gettag{
-	files=`{ls .pro/todo/}
+	files=`{ls .pro/task/}
 	if(! ~ $#change 0)
 		tag=$change
 	if not
@@ -50,7 +50,7 @@
 }
 
 fn final{
-	cp $msgfile .pro/todo/$tag
+	cp $msgfile .pro/task/$tag
 }
 
 fn sigexit{
@@ -62,11 +62,11 @@
 eval `''{aux/getflags $*} || exec aux/usage
 
 msgfile=/tmp/pro-msg.$pid
-if(! ~ $#* 0){
+if(! ~ $#* 0)
 	data=`{echo $*}
 if(! ~ $#change 0 )
-	if(test -s .pro/todo/$change){
-		cat .pro/todo/$change > $msgfile.tmp
+	if(test -s .pro/task/$change){
+		cat .pro/task/$change > $msgfile.tmp
 		if(! ~ $#data 0)
 			echo $data >> $msgfile.tmp
 	}