From: Jim Meyering Date: Thu, 9 Dec 1999 15:39:38 +0000 (+0000) Subject: (anonymous enum): Define TIME_OPTION, and ... X-Git-Tag: FILEUTILS-4_0l~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6cbabe63d4b26342e5900d657618f0342a14053e;p=thirdparty%2Fcoreutils.git (anonymous enum): Define TIME_OPTION, and ... (longopts): ...use it here instead of `CHAR_MAX + 1'. (main): Likewise. --- diff --git a/src/touch.c b/src/touch.c index 2db00d3049..5e638005a0 100644 --- a/src/touch.c +++ b/src/touch.c @@ -78,9 +78,16 @@ static char *ref_file; /* Info about the reference file. */ static struct stat ref_stats; +/* For long options that have no equivalent short option, use a + non-character as a pseudo short option, starting with CHAR_MAX + 1. */ +enum +{ + TIME_OPTION = CHAR_MAX + 1 +}; + static struct option const longopts[] = { - {"time", required_argument, 0, CHAR_MAX + 1}, + {"time", required_argument, 0, TIME_OPTION}, {"no-create", no_argument, 0, 'c'}, {"date", required_argument, 0, 'd'}, {"file", required_argument, 0, 'r'}, /* FIXME: phase out --file */ @@ -276,7 +283,7 @@ main (int argc, char **argv) date_set++; break; - case CHAR_MAX + 1: /* --time */ + case TIME_OPTION: /* --time */ change_times |= XARGMATCH ("--time", optarg, time_args, time_masks); break;