better status

This commit is contained in:
rsc 2006-07-23 14:41:55 +00:00
parent 32a580f43c
commit 5fa0329137

16
dist/isum.awk vendored
View file

@ -10,13 +10,14 @@ BEGIN {
updates = "/dev/stderr"
}
function clearstatus( i)
function clearstatus( noflush, i)
{
if(!updates)
return
for(i=0; i<statuslen; i++)
printf("\b \b") >updates
statuslen = 0
if(!noflush)
fflush(updates)
}
@ -24,7 +25,7 @@ function status(s)
{
if(!updates)
return
clearstatus()
clearstatus(1)
printf(" %s ", s) >updates
statuslen = length(s)+5
fflush(updates)
@ -75,6 +76,12 @@ debug!=0 { print "# " $0 }
next
}
/^cd .+; mk .+/ && !verbose {
dir = $2
sub(/;$/, "", dir)
status(dir " mk " $4)
}
/^cd / {
if(debug) print "% cd"
errors = 0
@ -86,11 +93,6 @@ debug!=0 { print "# " $0 }
fflush(copy)
}
}
else{
dir = $2
sub(/;$/, "", dir)
status(dir)
}
cd = $0 "\n"
cmd = ""
next