2 Copyright © 2013 Alastair Stuart
4 This program is open source software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
23 #define VERSION "0.01"
25 void usage(char* program
)
27 printf("Usage: %s [options] [file ...]\n", program
);
28 printf("Deletes directories.\n"
30 " --help Print this message.\n"
31 " --version Show version info.\n");
34 int main(int argc
, char* argv
[])
38 static struct option long_options
[] = {
39 {"help", no_argument
, NULL
, 1},
40 {"version", no_argument
, NULL
, 2},
45 while ((c
= getopt_long(argc
, argv
, "",
46 long_options
, NULL
)) != -1)
54 printf("rmdir (mutos) v"VERSION
"\n");
57 fprintf(stderr
,"Run '%s --help' for usage.\n",
63 for (int i
= optind
; i
< argc
; i
++)
65 int rc
= rmdir(argv
[i
]);
67 fprintf(stderr
, "%s: %s: %s\n",
68 argv
[0], strerror(errno
), argv
[i
]);