From fdd07e3d2b4113a076cbb862115c43c9285e8b55 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 31 Mar 1999 05:52:46 +0000 Subject: No longer include long-options.h. [long_options]: Add entries for --help and --version. Remove parse_long_options call. (main) [getopt switch]: Add a case for each of --help and --version. --- src/tty.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/tty.c') diff --git a/src/tty.c b/src/tty.c index 2e1e2ee04..f1c4310bc 100644 --- a/src/tty.c +++ b/src/tty.c @@ -30,7 +30,6 @@ #include "system.h" #include "closeout.h" #include "error.h" -#include "long-options.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "tty" @@ -47,6 +46,8 @@ static struct option const longopts[] = { {"silent", no_argument, NULL, 's'}, {"quiet", no_argument, NULL, 's'}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, {NULL, 0, NULL, 0} }; @@ -82,9 +83,6 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - AUTHORS, usage); - silent = 0; while ((optc = getopt_long (argc, argv, "s", longopts, NULL)) != -1) @@ -98,6 +96,10 @@ main (int argc, char **argv) silent = 1; break; + case_GETOPT_HELP_CHAR; + + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + default: usage (2); } -- cgit v1.2.3-54-g00ecf