1
0
mirror of git://git.suckless.org/sbase synced 2024-12-23 15:34:38 +00:00
sbase/rm.c
sin 7f6d5653c6 Add -R as a synonym to -r for rm(1)
Some scripts require this.
2013-12-12 13:15:47 +00:00

40 lines
541 B
C

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