]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
No longer include long-options.h.
authorJim Meyering <jim@meyering.net>
Fri, 26 Mar 1999 04:11:15 +0000 (04:11 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 26 Mar 1999 04:11:15 +0000 (04:11 +0000)
Include version-etc.h instead.
(PROGRAM_NAME): Define.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.

src/chgrp.c
src/chmod.c

index e6e21dcd979575355a7bd79cd9cdfd64f86a1de2..891c275e7b27dc82f139ac016143dade8c665b23 100644 (file)
 #include "closeout.h"
 #include "error.h"
 #include "group-member.h"
-#include "long-options.h"
 #include "savedir.h"
+#include "version-etc.h"
 #include "xstrtoul.h"
 
+/* The official name of this program (e.g., no `g' prefix).  */
+#define PROGRAM_NAME "chgrp"
+
 /* MAXUID may come from limits.h *or* sys/params.h (via system.h) above. */
 #ifndef MAXUID
 # define MAXUID UID_T_MAX
@@ -107,6 +110,8 @@ static struct option const long_options[] =
   {"quiet", no_argument, 0, 'f'},
   {"reference", required_argument, 0, CHAR_MAX + 1},
   {"verbose", no_argument, 0, 'v'},
+  {GETOPT_HELP_OPTION_DECL},
+  {GETOPT_VERSION_OPTION_DECL},
   {0, 0, 0, 0}
 };
 
@@ -328,9 +333,6 @@ 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)
@@ -357,6 +359,8 @@ main (int argc, char **argv)
        case 'v':
          verbosity = V_high;
          break;
+       case_GETOPT_HELP_CHAR;
+       case_GETOPT_VERSION_CHAR (PROGRAM_NAME, "David MacKenzie");
        default:
          usage (1);
        }
index 748ee2189c93e2cecb89b08d66c781e558e72508..40597b7d1d5d2cf67e1b0e69a96e580b30a84586 100644 (file)
 #include "closeout.h"
 #include "error.h"
 #include "filemode.h"
-#include "long-options.h"
 #include "modechange.h"
 #include "savedir.h"
+#include "version-etc.h"
+
+/* The official name of this program (e.g., no `g' prefix).  */
+#define PROGRAM_NAME "chmod"
 
 enum Change_status
 {
@@ -79,6 +82,8 @@ static struct option const long_options[] =
   {"quiet", no_argument, 0, 'f'},
   {"reference", required_argument, 0, CHAR_MAX + 1},
   {"verbose", no_argument, 0, 'v'},
+  {GETOPT_HELP_OPTION_DECL},
+  {GETOPT_VERSION_OPTION_DECL},
   {0, 0, 0, 0}
 };
 
@@ -273,9 +278,6 @@ 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)
@@ -323,6 +325,8 @@ main (int argc, char **argv)
        case 'v':
          verbosity = V_high;
          break;
+       case_GETOPT_HELP_CHAR;
+       case_GETOPT_VERSION_CHAR (PROGRAM_NAME, "David MacKenzie");
        default:
          usage (1);
        }