]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Define and use REFERENCE_FILE_OPTION and
authorJim Meyering <jim@meyering.net>
Sun, 7 Nov 1999 20:02:19 +0000 (20:02 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 7 Nov 1999 20:02:19 +0000 (20:02 +0000)
DEREFERENCE_OPTION in place of bare `CHAR_MAX + N'.

src/chgrp.c
src/chown.c

index c981586f18c00392aabb4e4f50e1d75c363bca4c..82f3ad0e46c8a5295de23f8b5ab1604138c192c1 100644 (file)
@@ -97,15 +97,23 @@ static const char *groupname;
    This file must exist.  */
 static char *reference_file;
 
+/* For long options that have no equivalent short option, use a
+   non-character as a pseudo short option, starting with CHAR_MAX + 1.  */
+enum
+{
+  REFERENCE_FILE_OPTION = CHAR_MAX + 1,
+  DEREFERENCE_OPTION
+};
+
 static struct option const long_options[] =
 {
   {"recursive", no_argument, 0, 'R'},
   {"changes", no_argument, 0, 'c'},
-  {"dereference", no_argument, 0, CHAR_MAX + 2},
+  {"dereference", no_argument, 0, DEREFERENCE_OPTION},
   {"no-dereference", no_argument, 0, 'h'},
   {"quiet", no_argument, 0, 'f'},
   {"silent", no_argument, 0, 'f'},
-  {"reference", required_argument, 0, CHAR_MAX + 1},
+  {"reference", required_argument, 0, REFERENCE_FILE_OPTION},
   {"verbose", no_argument, 0, 'v'},
   {GETOPT_HELP_OPTION_DECL},
   {GETOPT_VERSION_OPTION_DECL},
@@ -367,10 +375,10 @@ main (int argc, char **argv)
        {
        case 0:
          break;
-       case CHAR_MAX + 1:
+       case REFERENCE_FILE_OPTION:
          reference_file = optarg;
          break;
-       case CHAR_MAX + 2:
+       case DEREFERENCE_OPTION:
          change_symlinks = 0;
          break;
        case 'R':
index acae4206e2a821cab796bbd37c67154cd3ad8a79..9fc30552aa786e36f0cb661c74d251d032a8dce4 100644 (file)
@@ -107,15 +107,23 @@ static const char *groupname;
    of this file.  This file must exist.  */
 static char *reference_file;
 
+/* For long options that have no equivalent short option, use a
+   non-character as a pseudo short option, starting with CHAR_MAX + 1.  */
+enum
+{
+  REFERENCE_FILE_OPTION = CHAR_MAX + 1,
+  DEREFERENCE_OPTION
+};
+
 static struct option const long_options[] =
 {
   {"recursive", no_argument, 0, 'R'},
   {"changes", no_argument, 0, 'c'},
-  {"dereference", no_argument, 0, CHAR_MAX + 2},
+  {"dereference", no_argument, 0, DEREFERENCE_OPTION},
   {"no-dereference", no_argument, 0, 'h'},
   {"quiet", no_argument, 0, 'f'},
   {"silent", no_argument, 0, 'f'},
-  {"reference", required_argument, 0, CHAR_MAX + 1},
+  {"reference", required_argument, 0, REFERENCE_FILE_OPTION},
   {"verbose", no_argument, 0, 'v'},
   {GETOPT_HELP_OPTION_DECL},
   {GETOPT_VERSION_OPTION_DECL},
@@ -339,10 +347,10 @@ main (int argc, char **argv)
        {
        case 0:
          break;
-       case CHAR_MAX + 1:
+       case REFERENCE_FILE_OPTION:
          reference_file = optarg;
          break;
-       case CHAR_MAX + 2:
+       case DEREFERENCE_OPTION:
          change_symlinks = 0;
          break;
        case 'R':