vac: add -a and -x flags

Thanks to Michael Kaminsky for the suggestion.
This commit is contained in:
Russ Cox 2008-07-03 01:34:48 -04:00
parent d9841dc7ad
commit e05b0ff3eb
11 changed files with 551 additions and 83 deletions

31
src/cmd/vac/testinc.c Normal file
View file

@ -0,0 +1,31 @@
#include "stdinc.h"
#include "vac.h"
#include "dat.h"
#include "fns.h"
#include "error.h"
void
threadmain(int argc, char **argv)
{
Biobuf b;
char *p;
ARGBEGIN{
default:
goto usage;
}ARGEND
if(argc != 1){
usage:
fprint(2, "usage: testinc includefile\n");
threadexitsall("usage");
}
loadexcludefile(argv[0]);
Binit(&b, 0, OREAD);
while((p = Brdline(&b, '\n')) != nil){
p[Blinelen(&b)-1] = 0;
print("%d %s\n", includefile(p), p);
}
threadexitsall(0);
}