From 3d308f9549e4ae5b8bd29b6d32ecd47ebfa45360 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 26 Mar 1999 14:23:59 +0000 Subject: No longer include long-options.h. Include version-etc.h instead. (PROGRAM_NAME, AUTHORS): 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/mv.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/mv.c') diff --git a/src/mv.c b/src/mv.c index b56d4d4b7..fe9c86521 100644 --- a/src/mv.c +++ b/src/mv.c @@ -35,7 +35,7 @@ -V, --version-control Backup file creation. - Written by Mike Parker and David MacKenzie */ + Written by Mike Parker, David MacKenzie, and Jim Meyering */ #ifdef _AIX #pragma alloca @@ -53,9 +53,14 @@ #include "copy.h" #include "cp-hash.h" #include "error.h" -#include "long-options.h" #include "path-concat.h" #include "remove.h" +#include "version-etc.h" + +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "mv" + +#define AUTHORS "Mike Parker, David MacKenzie, and Jim Meyering" /* Initial number of entries in each hash table entry's table of inodes. */ #define INITIAL_HASH_MODULE 100 @@ -84,6 +89,8 @@ static struct option const long_options[] = {"update", no_argument, NULL, 'u'}, {"verbose", no_argument, NULL, 'v'}, {"version-control", required_argument, NULL, 'V'}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, {NULL, 0, NULL, 0} }; @@ -368,9 +375,6 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "mv", GNU_PACKAGE, VERSION, - "Mike Parker, David MacKenzie, and Jim Meyering", usage); - cp_option_init (&x); /* FIXME: consider not calling getenv for SIMPLE_BACKUP_SUFFIX unless @@ -411,6 +415,8 @@ main (int argc, char **argv) case 'V': version = optarg; break; + case_GETOPT_HELP_CHAR; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); default: usage (1); } -- cgit v1.2.3-54-g00ecf