diff options
author | Jim Meyering <jim@meyering.net> | 1999-11-07 20:02:19 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-11-07 20:02:19 +0000 |
commit | 5907ad7277bae60c7235a0efbfbe25fdd4534f2e (patch) | |
tree | cc814a51cf1024f47ccac308b48a5c0fb4201394 /src | |
parent | 1645ace5e752e258b4916e45d1ef1796625a3480 (diff) | |
download | coreutils-5907ad7277bae60c7235a0efbfbe25fdd4534f2e.tar.xz |
Define and use REFERENCE_FILE_OPTION and
DEREFERENCE_OPTION in place of bare `CHAR_MAX + N'.
Diffstat (limited to 'src')
-rw-r--r-- | src/chgrp.c | 16 | ||||
-rw-r--r-- | src/chown.c | 16 |
2 files changed, 24 insertions, 8 deletions
diff --git a/src/chgrp.c b/src/chgrp.c index c981586f1..82f3ad0e4 100644 --- a/src/chgrp.c +++ b/src/chgrp.c @@ -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': diff --git a/src/chown.c b/src/chown.c index acae4206e..9fc30552a 100644 --- a/src/chown.c +++ b/src/chown.c @@ -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': |