morpheus-base

morpheus base system
git clone git://git.2f30.org/morpheus-base
Log | Files | Refs

rmdir.c (416B)


      1 /* See LICENSE file for copyright and license details. */
      2 #include <stdio.h>
      3 #include <stdlib.h>
      4 #include <unistd.h>
      5 
      6 #include "util.h"
      7 
      8 static void
      9 usage(void)
     10 {
     11 	eprintf("usage: rmdir dir...\n");
     12 }
     13 
     14 int
     15 main(int argc, char *argv[])
     16 {
     17 	ARGBEGIN {
     18 	default:
     19 		usage();
     20 	} ARGEND;
     21 
     22 	if (argc < 1)
     23 		usage();
     24 
     25 	for (; argc > 0; argc--, argv++)
     26 		if (rmdir(argv[0]) < 0)
     27 			weprintf("rmdir %s:", argv[0]);
     28 	return 0;
     29 }