ref: e026625830c18a358a485d7c34002d3f853cac55
dir: /rm/
#!/bin/rc -e rfork ne fn checkstate { if(! ~ $#all 0){ if(! ~ $#force 0) rmlist=`{ls .pro/task} 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) rmlist=`{ls .pro/task/$tag} if not rmlist=`{pro/walk -q fC $tag && ls .pro/task/$tag} } } fn rmtask { 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' eval `''{aux/getflags $*} || exec aux/usage rmlist=() tag=$1 @{ flag e + checkstate rmtask } || echo 'could not rm task:' $status >[1=2] exit ''