From 88cbad981787d34f3dc8118bde16416c12a50421 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 4 Mar 1999 05:36:10 +0000 Subject: Include long-options.h [long_options]: Remove the "help" and "version" entries. Remove declarations of show_help and show_version. (main): Use parse_long_options, including author name(s). Remove the show_version and show_help blocks. --- src/cat.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'src/cat.c') diff --git a/src/cat.c b/src/cat.c index 5afae0da0..8e429a716 100644 --- a/src/cat.c +++ b/src/cat.c @@ -32,6 +32,7 @@ #endif #include "system.h" #include "error.h" +#include "long-options.h" #include "safe-read.h" /* Undefine, to avoid warning about redefinition on some systems. */ @@ -510,12 +511,6 @@ main (int argc, char **argv) /* If nonzero, call cat, otherwise call simple_cat to do the actual work. */ int options = 0; - /* If nonzero, display usage information and exit. */ - static int show_help; - - /* If nonzero, print the version on standard output then exit. */ - static int show_version; - static struct option const long_options[] = { {"number-nonblank", no_argument, NULL, 'b'}, @@ -528,8 +523,6 @@ main (int argc, char **argv) #if O_BINARY {"binary", no_argument, NULL, 'B'}, #endif - {"help", no_argument, &show_help, 1}, - {"version", no_argument, &show_version, 1}, {NULL, 0, NULL, 0} }; @@ -538,6 +531,9 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + parse_long_options (argc, argv, "cat", GNU_PACKAGE, VERSION, + "Torbjorn Granlund and Richard M. Stallman", usage); + /* Parse command line options. */ while ((c = getopt_long (argc, argv, @@ -619,15 +615,6 @@ main (int argc, char **argv) } } - if (show_version) - { - printf ("cat (%s) %s\n", GNU_PACKAGE, VERSION); - exit (EXIT_SUCCESS); - } - - if (show_help) - usage (0); - output_desc = 1; /* Get device, i-node number, and optimal blocksize of output. */ -- cgit v1.2.3-54-g00ecf