summaryrefslogtreecommitdiff
path: root/src/rmdir.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-03-26 14:25:30 +0000
committerJim Meyering <jim@meyering.net>1999-03-26 14:25:30 +0000
commite7f2703c4715165015f6d815a4861647f0863def (patch)
tree9a3b6277b145366bd936d2805fab9c0e39978a61 /src/rmdir.c
parent3d308f9549e4ae5b8bd29b6d32ecd47ebfa45360 (diff)
downloadcoreutils-e7f2703c4715165015f6d815a4861647f0863def.tar.xz
No longer include long-options.h.
Include version-etc.h instead. (PROGRAM_NAME, AUTHORS): Define. [long_options]: Add entries for --help and --version. Remove parse_long_options call. (main) [getopt switch]: Add a case for each of --help and --version.
Diffstat (limited to 'src/rmdir.c')
-rw-r--r--src/rmdir.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/rmdir.c b/src/rmdir.c
index 81e437e9f..54605ee43 100644
--- a/src/rmdir.c
+++ b/src/rmdir.c
@@ -30,7 +30,12 @@
#include "system.h"
#include "closeout.h"
#include "error.h"
-#include "long-options.h"
+#include "version-etc.h"
+
+/* The official name of this program (e.g., no `g' prefix). */
+#define PROGRAM_NAME "rmdir"
+
+#define AUTHORS "David MacKenzie"
#ifndef EEXIST
# define EEXIST 0
@@ -64,6 +69,8 @@ static struct option const longopts[] =
{"path", no_argument, NULL, 'p'},
{"parents", no_argument, NULL, 'p'},
{"verbose", no_argument, NULL, 14},
+ {GETOPT_HELP_OPTION_DECL},
+ {GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
};
@@ -145,9 +152,6 @@ 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)
@@ -165,6 +169,8 @@ main (int argc, char **argv)
case 14:
verbose = 1;
break;
+ case_GETOPT_HELP_CHAR;
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
usage (1);
}