ref: 156d0b3f8f89cb2b8f5ea79304dc63c24b6d1cda
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 ''