diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-04 05:36:10 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-04 05:36:10 +0000 |
commit | 88cbad981787d34f3dc8118bde16416c12a50421 (patch) | |
tree | 1a8993c9e22726767a534efd76dd619bfc80752d /src/head.c | |
parent | 0ae96f236175101ddc6c8f0eaf46d08f88173486 (diff) | |
download | coreutils-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/head.c')
-rw-r--r-- | src/head.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/head.c b/src/head.c index 2933fee3b..8a4fdbe99 100644 --- a/src/head.c +++ b/src/head.c @@ -31,6 +31,7 @@ #include <sys/types.h> #include "system.h" #include "error.h" +#include "long-options.h" #include "xstrtoul.h" #include "safe-read.h" @@ -58,12 +59,6 @@ char *program_name; /* Have we ever read standard input? */ static int have_read_stdin; -/* 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[] = { {"bytes", required_argument, NULL, 'c'}, @@ -71,8 +66,6 @@ static struct option const long_options[] = {"quiet", no_argument, NULL, 'q'}, {"silent", no_argument, NULL, 'q'}, {"verbose", no_argument, NULL, 'v'}, - {"help", no_argument, &show_help, 1}, - {"version", no_argument, &show_version, 1}, {NULL, 0, NULL, 0} }; @@ -268,6 +261,9 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + parse_long_options (argc, argv, "head", GNU_PACKAGE, VERSION, + "David MacKenzie", usage); + have_read_stdin = 0; print_headers = 0; @@ -372,15 +368,6 @@ main (int argc, char **argv) } } - if (show_version) - { - printf ("head (%s) %s\n", GNU_PACKAGE, VERSION); - exit (EXIT_SUCCESS); - } - - if (show_help) - usage (0); - if (header_mode == always || (header_mode == multiple_files && optind < argc - 1)) print_headers = 1; |