summaryrefslogtreecommitdiff
path: root/src/chmod.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/chmod.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/chmod.c')
-rw-r--r--src/chmod.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/chmod.c b/src/chmod.c
index 66537ca1e..c2d978dad 100644
--- a/src/chmod.c
+++ b/src/chmod.c
@@ -22,12 +22,13 @@
#include <getopt.h>
#include <sys/types.h>
-#include "modechange.h"
#include "system.h"
#include "closeout.h"
#include "error.h"
-#include "savedir.h"
#include "filemode.h"
+#include "long-options.h"
+#include "modechange.h"
+#include "savedir.h"
enum Change_status
{
@@ -70,12 +71,6 @@ static enum Verbosity verbosity = V_off;
of this file. This file must exist. */
static char *reference_file;
-/* 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[] =
{
{"recursive", no_argument, 0, 'R'},
@@ -84,8 +79,6 @@ static struct option const long_options[] =
{"quiet", no_argument, 0, 'f'},
{"reference", required_argument, 0, CHAR_MAX + 1},
{"verbose", no_argument, 0, 'v'},
- {"help", no_argument, &show_help, 1},
- {"version", no_argument, &show_version, 1},
{0, 0, 0, 0}
};
@@ -279,6 +272,9 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ parse_long_options (argc, argv, "chmod", GNU_PACKAGE, VERSION,
+ "David MacKenzie", usage);
+
recurse = force_silent = 0;
while (1)
@@ -331,16 +327,6 @@ main (int argc, char **argv)
}
}
- if (show_version)
- {
- printf ("chmod (%s) %s\n", GNU_PACKAGE, VERSION);
- close_stdout ();
- exit (0);
- }
-
- if (show_help)
- usage (0);
-
if (modeind == 0 && reference_file == NULL)
modeind = optind++;