ref: a76c9468ca5956257e6d1b6720716ab2df65a205
dir: /rm/
#!/bin/rc -e rfork ne fn cleanlinks { # Walk through any related tags, and remove any blockable references } fn checkstate { if(! ~ $#all 0){ if(! ~ $#force 0) rmlist=`{ls .task} if not { # TODO: This will need to be filtered to just our project after #rmlist=`{task/walk -c -fC -p $project} rmlist=`{task/walk -c -fC} } } if not { if(! ~ $#force 0) rmlist=`{ls .task/$tag} if not rmlist=`{task/walk -q fC $tag && ls .task/$tag} } } fn rmtask { for(m in $rmlist){ # TODO: when we have multiproject #echo $project/$m completed echo $m completed rm $m } } flagfmt='f:force, a:all'; args='tag' eval `''{aux/getflags $*} || exec aux/usage rmlist=() tag=$1 @{ flag e + checkstate rmtask cleanlinks } || echo 'could not rm task:' $status >[1=2] exit ''