ref: 57a3cb892d1df2f3787531e0ead84c8e943744ea
dir: /rm/
#!/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 ''