summaryrefslogtreecommitdiff
path: root/src/rmdir.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-03-04 05:09:05 +0000
committerJim Meyering <jim@meyering.net>1999-03-04 05:09:05 +0000
commit61fa70ac19d9202f6509e97e4bda1f4ab8f5d1fd (patch)
tree1fb89b9b511548ea40a899b6c60f1371cf6123f4 /src/rmdir.c
parentd0bdbe00ba72224915a61589a399bc0e86d74d80 (diff)
downloadcoreutils-61fa70ac19d9202f6509e97e4bda1f4ab8f5d1fd.tar.xz
Include long-options.h
[long_options]: Remove the "help" and "version" entries. (main): Use parse_long_options, including author name(s). Remove the show_version and show_help blocks.
Diffstat (limited to 'src/rmdir.c')
-rw-r--r--src/rmdir.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/rmdir.c b/src/rmdir.c
index 705048428..81e437e9f 100644
--- a/src/rmdir.c
+++ b/src/rmdir.c
@@ -30,6 +30,7 @@
#include "system.h"
#include "closeout.h"
#include "error.h"
+#include "long-options.h"
#ifndef EEXIST
# define EEXIST 0
@@ -54,12 +55,6 @@ static int ignore_fail_on_non_empty;
/* If nonzero, output a diagnostic for every directory processed. */
static int verbose;
-/* If nonzero, display usage information and exit. */
-static int show_help;
-
-/* If nonzero, print the version on standard output and exit. */
-static int show_version;
-
static struct option const longopts[] =
{
/* Don't name this `--force' because it's not close enough in meaning
@@ -69,8 +64,6 @@ static struct option const longopts[] =
{"path", no_argument, NULL, 'p'},
{"parents", no_argument, NULL, 'p'},
{"verbose", no_argument, NULL, 14},
- {"help", no_argument, &show_help, 1},
- {"version", no_argument, &show_version, 1},
{NULL, 0, NULL, 0}
};
@@ -152,6 +145,9 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ parse_long_options (argc, argv, "rmdir", GNU_PACKAGE, VERSION,
+ "David MacKenzie", usage);
+
empty_paths = 0;
while ((optc = getopt_long (argc, argv, "p", longopts, NULL)) != -1)
@@ -174,16 +170,6 @@ main (int argc, char **argv)
}
}
- if (show_version)
- {
- printf ("rmdir (%s) %s\n", GNU_PACKAGE, VERSION);
- close_stdout ();
- exit (0);
- }
-
- if (show_help)
- usage (0);
-
if (optind == argc)
{
error (0, 0, _("too few arguments"));