summaryrefslogtreecommitdiff
path: root/src/mv.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-03-04 05:09:05 +0000
committerJim Meyering <jim@meyering.net>1999-03-04 05:09:05 +0000
commit61fa70ac19d9202f6509e97e4bda1f4ab8f5d1fd (patch)
tree1fb89b9b511548ea40a899b6c60f1371cf6123f4 /src/mv.c
parentd0bdbe00ba72224915a61589a399bc0e86d74d80 (diff)
downloadcoreutils-61fa70ac19d9202f6509e97e4bda1f4ab8f5d1fd.tar.xz
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.
Diffstat (limited to 'src/mv.c')
-rw-r--r--src/mv.c28
1 files changed, 7 insertions, 21 deletions
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 <assert.h>
#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