if(bkselect(pb, s))
r = 1;
} else if(S_ISREG(sb.st_mode) || S_ISLNK(sb.st_mode)) {
- if(s && printnames)
- printf("%s\n", pb);
- tsize += sb.st_size;
+ if(s) {
+ if(printnames)
+ printf("%s\n", pb);
+ tsize += sb.st_size;
+ }
}
}
void usage(void)
{
- fprintf(stderr, "usage: bkselect [-hsq] path...\n");
+ fprintf(stderr, "usage: bkselect [-hsqo] path...\n");
}
int main(int argc, char **argv)
{
- int c, i, r;
+ int c, i, r, s;
- while((c = getopt(argc, argv, "hsq")) >= 0) {
+ s = 1;
+ while((c = getopt(argc, argv, "hsqo")) >= 0) {
switch(c) {
case 's':
printsize = 1;
case 'q':
printnames = 0;
break;
+ case 'o':
+ s = 0;
+ break;
case 'h':
default:
usage();
}
r = 0;
for(i = optind; i < argc; i++) {
- if(bkselect(argv[i], 0))
+ if(bkselect(argv[i], s))
r = 1;
}
if(printsize)