diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-06 15:28:54 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-06 15:28:54 +0000 |
commit | 5b2aa1846bc8dc6d8ffce7d523cebc1ab45a17d7 (patch) | |
tree | 84329e3e3519feb76d3835f81928c4b657c495cf /src/who.c | |
parent | 782b27031417465b6d79e2d0d8c608b8ea842ce9 (diff) | |
download | coreutils-5b2aa1846bc8dc6d8ffce7d523cebc1ab45a17d7.tar.gz coreutils-5b2aa1846bc8dc6d8ffce7d523cebc1ab45a17d7.tar.bz2 coreutils-5b2aa1846bc8dc6d8ffce7d523cebc1ab45a17d7.zip |
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/who.c')
-rw-r--r-- | src/who.c | 24 |
1 files changed, 6 insertions, 18 deletions
@@ -29,6 +29,7 @@ #include <stdio.h> #include "error.h" +#include "long-options.h" #include "readutmp.h" #include "system.h" @@ -46,12 +47,6 @@ char *ttyname (); /* The 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; - /* If nonzero, attempt to canonicalize hostnames via a DNS lookup. */ static int do_lookup; @@ -81,8 +76,6 @@ static struct option const longopts[] = {"message", no_argument, NULL, 'T'}, {"mesg", no_argument, NULL, 'T'}, {"writable", no_argument, NULL, 'T'}, - {"help", no_argument, &show_help, 1}, - {"version", no_argument, &show_version, 1}, {NULL, 0, NULL, 0} }; @@ -390,7 +383,11 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - while ((optc = getopt_long (argc, argv, "ilmqsuwHT", longopts, &longind)) != -1) + parse_long_options (argc, argv, "who", GNU_PACKAGE, VERSION, + "Joseph Arceneaux and David MacKenzie", usage); + + while ((optc = getopt_long (argc, argv, "ilmqsuwHT", longopts, &longind)) + != -1) { switch (optc) { @@ -431,15 +428,6 @@ main (int argc, char **argv) } } - if (show_version) - { - printf ("who (%s) %s\n", GNU_PACKAGE, VERSION); - exit (0); - } - - if (show_help) - usage (0); - switch (argc - optind) { case 0: /* who */ |