summaryrefslogtreecommitdiff
path: root/src/split.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-09-21 22:13:53 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-09-21 22:13:53 +0000
commit9873bd7eb683857ba25de884ee4427458d3088ed (patch)
treed42f1592e30248def74002a549d8d45c3a2a969d /src/split.c
parent26877d8d3160a18fb26991953ecc4b02d80353a9 (diff)
downloadcoreutils-9873bd7eb683857ba25de884ee4427458d3088ed.tar.xz
(main): Remove unused "case 0".
(verbose): Now bool, not int. (VERBOSE_OPTION): New enum. (longopts, main): Use it.
Diffstat (limited to 'src/split.c')
-rw-r--r--src/split.c20
1 files changed, 14 insertions, 6 deletions
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);