sbase/rm.c
FRIGN 6f715d8c6d Audit rm(1)
1) One small argc-style-matter
2) manpage cleanup
3) NOTE: The utility-functions will be evaluated separately.
2015-02-28 21:31:23 +01:00

38 lines
478 B
C

/* See LICENSE file for copyright and license details. */
#include "fs.h"
#include "util.h"
static void
usage(void)
{
eprintf("usage: %s [-f] [-Rr] file ...\n", argv0);
}
int
main(int argc, char *argv[])
{
ARGBEGIN {
case 'f':
rm_fflag = 1;
break;
case 'R':
case 'r':
rm_rflag = 1;
break;
default:
usage();
} ARGEND;
if (!argc) {
if (!rm_fflag)
usage();
else
return 0;
}
for (; argc > 0; argc--, argv++)
rm(argv[0], 0);
return rm_status;
}