From 9873bd7eb683857ba25de884ee4427458d3088ed Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 21 Sep 2004 22:13:53 +0000 Subject: (main): Remove unused "case 0". (verbose): Now bool, not int. (VERBOSE_OPTION): New enum. (longopts, main): Use it. --- src/split.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/split.c') diff --git a/src/split.c b/src/split.c index bd8a150e9..8ada6002f 100644 --- a/src/split.c +++ b/src/split.c @@ -74,9 +74,16 @@ static int input_desc; /* Descriptor on which output file is open. */ static int output_desc; -/* If nonzero, print a diagnostic on standard error just before each +/* If true, print a diagnostic on standard error just before each output file is opened. */ -static int verbose; +static bool verbose; + +/* For long options that have no equivalent short option, use a + non-character as a pseudo short option, starting with CHAR_MAX + 1. */ +enum +{ + VERBOSE_OPTION = CHAR_MAX + 1 +}; static struct option const longopts[] = { @@ -85,7 +92,7 @@ static struct option const longopts[] = {"line-bytes", required_argument, NULL, 'C'}, {"suffix-length", required_argument, NULL, 'a'}, {"numeric-suffixes", no_argument, NULL, 'd'}, - {"verbose", no_argument, &verbose, 1}, + {"verbose", no_argument, NULL, VERBOSE_OPTION}, {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, {NULL, 0, NULL, 0} @@ -404,9 +411,6 @@ main (int argc, char **argv) switch (c) { - case 0: - break; - case 'a': { unsigned long tmp; @@ -491,6 +495,10 @@ main (int argc, char **argv) suffix_alphabet = "0123456789"; break; + case VERBOSE_OPTION: + verbose = true; + break; + case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); -- cgit v1.2.3-54-g00ecf