summaryrefslogtreecommitdiff
path: root/src/chgrp.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/chgrp.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/chgrp.c')
-rw-r--r--src/chgrp.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/chgrp.c b/src/chgrp.c
index 19d233c69..109edbc57 100644
--- a/src/chgrp.c
+++ b/src/chgrp.c
@@ -24,11 +24,12 @@
#include <getopt.h>
#include "system.h"
-#include "xstrtoul.h"
#include "closeout.h"
#include "error.h"
-#include "savedir.h"
#include "group-member.h"
+#include "long-options.h"
+#include "savedir.h"
+#include "xstrtoul.h"
/* MAXUID may come from limits.h *or* sys/params.h (via system.h) above. */
#ifndef MAXUID
@@ -97,12 +98,6 @@ static const char *groupname;
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'},
@@ -112,8 +107,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}
};
@@ -335,6 +328,9 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ parse_long_options (argc, argv, "chgrp", GNU_PACKAGE, VERSION,
+ "David MacKenzie", usage);
+
recurse = force_silent = 0;
while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, NULL)) != -1)
@@ -366,16 +362,6 @@ main (int argc, char **argv)
}
}
- if (show_version)
- {
- printf ("chgrp (%s) %s\n", GNU_PACKAGE, VERSION);
- close_stdout ();
- exit (0);
- }
-
- if (show_help)
- usage (0);
-
if (argc - optind + (reference_file ? 1 : 0) <= 1)
{
error (0, 0, _("too few arguments"));