From 61fa70ac19d9202f6509e97e4bda1f4ab8f5d1fd Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 4 Mar 1999 05:09:05 +0000 Subject: 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. --- src/rm.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'src/rm.c') diff --git a/src/rm.c b/src/rm.c index 1642ec3fb..1dbdfbbf7 100644 --- a/src/rm.c +++ b/src/rm.c @@ -49,23 +49,18 @@ #include #include -#include "save-cwd.h" #include "system.h" #include "closeout.h" #include "error.h" +#include "long-options.h" #include "remove.h" +#include "save-cwd.h" void strip_trailing_slashes (); /* Name this program was run with. */ char *program_name; -/* 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 long_opts[] = { {"directory", no_argument, NULL, 'd'}, @@ -73,8 +68,6 @@ static struct option const long_opts[] = {"interactive", no_argument, NULL, 'i'}, {"recursive", no_argument, NULL, 'r'}, {"verbose", no_argument, NULL, 'v'}, - {"help", no_argument, &show_help, 1}, - {"version", no_argument, &show_version, 1}, {NULL, 0, NULL, 0} }; @@ -127,6 +120,10 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + parse_long_options (argc, argv, "rm", GNU_PACKAGE, VERSION, + "Paul Rubin, David MacKenzie, Richard Stallman, and Jim Meyering", + usage); + rm_option_init (&x); while ((c = getopt_long (argc, argv, "dfirvR", long_opts, NULL)) != -1) @@ -158,16 +155,6 @@ main (int argc, char **argv) } } - if (show_version) - { - printf ("rm (%s) %s\n", GNU_PACKAGE, VERSION); - close_stdout (); - exit (0); - } - - if (show_help) - usage (0); - if (optind == argc) { if (x.ignore_missing_files) -- cgit v1.2.3-54-g00ecf