]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Simplify getopt_long() usage
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 15 Jul 2010 14:58:32 +0000 (16:58 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 15 Jul 2010 17:20:33 +0000 (19:20 +0200)
ccache.c

index 7678ba524eabb5aed8cfb7f42bee103b1c031529..c51104119972aa5849430044bc47594ce67ae89f 100644 (file)
--- 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);