From: Joel Rosdahl Date: Thu, 15 Jul 2010 14:58:32 +0000 (+0200) Subject: Simplify getopt_long() usage X-Git-Tag: v3.1~180^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c58b743679fd8debca20a3cb220ced3dc0cc34e2;p=thirdparty%2Fccache.git Simplify getopt_long() usage --- diff --git a/ccache.c b/ccache.c index 7678ba524..c51104119 100644 --- a/ccache.c +++ b/ccache.c @@ -2000,7 +2000,7 @@ static int ccache_main(int argc, char *argv[]) int c; size_t v; - static const struct option long_options[] = { + static const struct option options[] = { {"show-stats", no_argument, 0, 's'}, {"zero-stats", no_argument, 0, 'z'}, {"cleanup", no_argument, 0, 'c'}, @@ -2011,9 +2011,8 @@ static int ccache_main(int argc, char *argv[]) {"version", no_argument, 0, 'V'}, {0, 0, 0, 0} }; - int option_index = 0; - while ((c = getopt_long(argc, argv, "hszcCF:M:V", long_options, &option_index)) != -1) { + while ((c = getopt_long(argc, argv, "hszcCF:M:V", options, NULL)) != -1) { switch (c) { case 'V': fprintf(stdout, VERSION_TEXT, CCACHE_VERSION);