mirror of
git://git.suckless.org/sbase
synced 2024-12-24 16:02:54 +00:00
8f7bc0db35
Use arg.h- and pointer-iterator-idioms.
33 lines
502 B
C
33 lines
502 B
C
/* See LICENSE file for copyright and license details. */
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
#include <errno.h>
|
|
#include "util.h"
|
|
|
|
static void
|
|
usage(void)
|
|
{
|
|
eprintf("usage: rmdir dir...\n");
|
|
}
|
|
|
|
int
|
|
main(int argc, char *argv[])
|
|
{
|
|
ARGBEGIN {
|
|
default:
|
|
usage();
|
|
} ARGEND;
|
|
|
|
if (argc < 1)
|
|
usage();
|
|
|
|
for(; argc > 0; argc--, argv++)
|
|
if(rmdir(argv[0]) == -1)
|
|
fprintf(stderr, "rmdir: '%s': %s\n",
|
|
argv[0], strerror(errno));
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|