hlfw.ca

task

ref: 09c2fc351115c87390601cb39f5cd480b24e555a
dir: /rm/

View raw version
#!/bin/rc -e
rfork ne

fn checkstate {
	if(! ~ $#all 0){
		if(! ~ $#force 0)
			rmlist=`{ls .pro/todo}
		if not
			rmlist=`{pro/walk -c -fC}
	}
	if not {
		if(! ~ $#force 0)
			rmlist=`{ls .pro/todo/$tag}
		if not
			rmlist=`{pro/walk -q fC $tag && ls .pro/todo/$tag}
	}
}

fn rmtask {
	for(m in $rmlist)
		rm $m
}

flagfmt='f:force, a:all'; args='tag'
eval `''{aux/getflags $*} || exec aux/usage
rmlist=()
tag=$1
@{
	flag e +
	checkstate
	rmtask
} || echo 'could not rm task:' $status >[1=2]
exit ''