summaryrefslogtreecommitdiff
path: root/src/cat.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-03-04 05:36:10 +0000
committerJim Meyering <jim@meyering.net>1999-03-04 05:36:10 +0000
commit88cbad981787d34f3dc8118bde16416c12a50421 (patch)
tree1a8993c9e22726767a534efd76dd619bfc80752d /src/cat.c
parent0ae96f236175101ddc6c8f0eaf46d08f88173486 (diff)
downloadcoreutils-88cbad981787d34f3dc8118bde16416c12a50421.tar.xz
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.
Diffstat (limited to 'src/cat.c')
-rw-r--r--src/cat.c21
1 files changed, 4 insertions, 17 deletions
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. */