From 61fa70ac19d9202f6509e97e4bda1f4ab8f5d1fd Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 4 Mar 1999 05:09:05 +0000 Subject: Include long-options.h [long_options]: Remove the "help" and "version" entries. (main): Use parse_long_options, including author name(s). Remove the show_version and show_help blocks. --- src/mv.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'src/mv.c') diff --git a/src/mv.c b/src/mv.c index 89f0feba7..b56d4d4b7 100644 --- a/src/mv.c +++ b/src/mv.c @@ -48,13 +48,14 @@ #include #include "system.h" -#include "path-concat.h" #include "backupfile.h" #include "closeout.h" -#include "cp-hash.h" #include "copy.h" -#include "remove.h" +#include "cp-hash.h" #include "error.h" +#include "long-options.h" +#include "path-concat.h" +#include "remove.h" /* Initial number of entries in each hash table entry's table of inodes. */ #define INITIAL_HASH_MODULE 100 @@ -74,12 +75,6 @@ char *program_name; /* If nonzero, stdin is a tty. */ static int stdin_tty; -/* 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; - static struct option const long_options[] = { {"backup", no_argument, NULL, 'b'}, @@ -89,8 +84,6 @@ static struct option const long_options[] = {"update", no_argument, NULL, 'u'}, {"verbose", no_argument, NULL, 'v'}, {"version-control", required_argument, NULL, 'V'}, - {"help", no_argument, &show_help, 1}, - {"version", no_argument, &show_version, 1}, {NULL, 0, NULL, 0} }; @@ -375,6 +368,9 @@ 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 @@ -420,16 +416,6 @@ main (int argc, char **argv) } } - if (show_version) - { - printf ("mv (%s) %s\n", GNU_PACKAGE, VERSION); - close_stdout (); - exit (0); - } - - if (show_help) - usage (0); - if (argc < optind + 2) { error (0, 0, "%s", (argc == optind -- cgit v1.2.3-70-g09d2