]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): Remove unused "case 0".
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 21 Sep 2004 22:13:53 +0000 (22:13 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 21 Sep 2004 22:13:53 +0000 (22:13 +0000)
(verbose): Now bool, not int.
(VERBOSE_OPTION): New enum.
(longopts, main): Use it.

src/split.c

index bd8a150e9bc959eea44a587eee863db400e01fad..8ada6002fa7154173f4823cad18bbcc7342e2522 100644 (file)
@@ -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);