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/uniq.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/uniq.c')
-rw-r--r-- | src/uniq.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/uniq.c b/src/uniq.c index 5916ba9c2..5f664178b 100644 --- a/src/uniq.c +++ b/src/uniq.c @@ -25,6 +25,7 @@ #include "system.h" #include "linebuffer.h" +#include "long-options.h" #include "error.h" #include "xstrtol.h" #include "memcasecmp.h" @@ -69,12 +70,6 @@ static enum output_mode mode; /* If nonzero, ignore case when comparing. */ static int ignore_case; -/* 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 longopts[] = { {"count", no_argument, NULL, 'c'}, @@ -85,8 +80,6 @@ static struct option const longopts[] = {"skip-fields", required_argument, NULL, 'f'}, {"skip-chars", required_argument, NULL, 's'}, {"check-chars", required_argument, NULL, 'w'}, - {"help", no_argument, &show_help, 1}, - {"version", no_argument, &show_version, 1}, {NULL, 0, NULL, 0} }; @@ -291,6 +284,9 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + parse_long_options (argc, argv, "uniq", GNU_PACKAGE, VERSION, + "Richard Stallman and David MacKenzie", usage); + skip_chars = 0; skip_fields = 0; check_chars = 0; @@ -379,15 +375,6 @@ main (int argc, char **argv) } } - if (show_version) - { - printf ("uniq (%s) %s\n", GNU_PACKAGE, VERSION); - exit (EXIT_SUCCESS); - } - - if (show_help) - usage (0); - if (optind >= 2 && !STREQ (argv[optind - 1], "--")) { /* Interpret non-option arguments with leading `+' only |