summaryrefslogtreecommitdiff
path: root/src/install.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/install.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/install.c')
-rw-r--r--src/install.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/install.c b/src/install.c
index 757a710aa..71de8e41b 100644
--- a/src/install.c
+++ b/src/install.c
@@ -73,15 +73,16 @@
#include "system.h"
#include "backupfile.h"
-#include "modechange.h"
-#include "makepath.h"
#include "closeout.h"
#include "error.h"
-#include "xstrtol.h"
-#include "path-concat.h"
#include "cp-hash.h"
#include "copy.h"
#include "dirname.h"
+#include "long-options.h"
+#include "makepath.h"
+#include "modechange.h"
+#include "path-concat.h"
+#include "xstrtol.h"
#if HAVE_SYS_WAIT_H
# include <sys/wait.h>
@@ -165,12 +166,6 @@ static int strip_files;
/* If nonzero, install a directory instead of a regular file. */
static int dir_arg;
-/* 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[] =
{
{"strip", no_argument, NULL, 's'},
@@ -183,8 +178,6 @@ static struct option const long_options[] =
{"suffix", required_argument, NULL, 'S'},
{"version-control", required_argument, NULL, 'V'},
{"verbose", no_argument, NULL, 'v'},
- {"help", no_argument, &show_help, 1},
- {"version", no_argument, &show_version, 1},
{NULL, 0, NULL, 0}
};
@@ -242,6 +235,9 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ parse_long_options (argc, argv, "install", GNU_PACKAGE, VERSION,
+ "David MacKenzie", usage);
+
cp_option_init (&x);
owner_name = NULL;
@@ -304,16 +300,6 @@ main (int argc, char **argv)
}
}
- if (show_version)
- {
- printf ("install (%s) %s\n", GNU_PACKAGE, VERSION);
- close_stdout ();
- exit (0);
- }
-
- if (show_help)
- usage (0);
-
/* Check for invalid combinations of arguments. */
if (dir_arg && strip_files)
error (1, 0,