From dd007634ac63e0b81472aeeee8706a1c68a35b98 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 26 Mar 1999 04:10:55 +0000 Subject: [PATCH] No longer include long-options.h. Include version-etc.h instead. (PROGRAM_NAME): Define. [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/chown.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/chown.c b/src/chown.c index 49e6f932cf..0904de6c39 100644 --- a/src/chown.c +++ b/src/chown.c @@ -38,9 +38,12 @@ #include "system.h" #include "closeout.h" #include "error.h" -#include "long-options.h" #include "lchown.h" #include "savedir.h" +#include "version-etc.h" + +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "chown" #ifndef _POSIX_VERSION struct passwd *getpwnam (); @@ -114,6 +117,8 @@ static struct option const long_options[] = {"silent", no_argument, 0, 'f'}, {"reference", required_argument, 0, CHAR_MAX + 1}, {"verbose", no_argument, 0, 'v'}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, {0, 0, 0, 0} }; @@ -326,9 +331,6 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "chown", GNU_PACKAGE, VERSION, - "David MacKenzie", usage); - recurse = force_silent = 0; while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, NULL)) != -1) @@ -358,6 +360,8 @@ main (int argc, char **argv) case 'v': verbosity = V_high; break; + case_GETOPT_HELP_CHAR; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, "David MacKenzie"); default: usage (1); } -- 2.47.3