diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-26 04:10:55 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-26 04:10:55 +0000 |
commit | dd007634ac63e0b81472aeeee8706a1c68a35b98 (patch) | |
tree | 63a14647a06577801d980bf8001faca1bedc019e /src/chown.c | |
parent | 562f29a2a28c45f5120404028ce0dafef9e12531 (diff) | |
download | coreutils-dd007634ac63e0b81472aeeee8706a1c68a35b98.tar.gz coreutils-dd007634ac63e0b81472aeeee8706a1c68a35b98.tar.bz2 coreutils-dd007634ac63e0b81472aeeee8706a1c68a35b98.zip |
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.
Diffstat (limited to 'src/chown.c')
-rw-r--r-- | src/chown.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/chown.c b/src/chown.c index 49e6f932c..0904de6c3 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); } |