sbase/rm.c

35 lines
490 B
C
Raw Normal View History

2011-05-23 20:52:28 -04:00
/* See LICENSE file for copyright and license details. */
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
2012-01-30 17:41:33 -05:00
#include <sys/stat.h>
#include "fs.h"
2011-05-23 20:52:28 -04:00
#include "util.h"
2013-06-14 14:20:47 -04:00
static void
usage(void)
{
eprintf("usage: %s [-fr] FILE...\n", argv0);
}
2011-05-23 20:52:28 -04:00
int
main(int argc, char *argv[])
{
2013-06-14 14:20:47 -04:00
ARGBEGIN {
case 'f':
rm_fflag = true;
break;
case 'r':
rm_rflag = true;
break;
default:
usage();
} ARGEND;
for(; argc > 0; argc--, argv++)
rm(argv[0]);
2011-05-23 20:52:28 -04:00
2013-06-14 14:20:47 -04:00
return 0;
2011-05-23 20:52:28 -04:00
}
2013-06-14 14:20:47 -04:00