]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
added a version number
authorAndrew Tridgell <tridge@samba.org>
Sat, 30 Mar 2002 12:35:26 +0000 (13:35 +0100)
committerAndrew Tridgell <tridge@samba.org>
Sat, 30 Mar 2002 12:35:26 +0000 (13:35 +0100)
Makefile
ccache.c
ccache.h

index 49fb4c9c19f390ec0840f114809fe2ff3e099a48..d91b90ca8bbbb1ead0983e3e714af95096cd5ebe 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-CFLAGS=-W -Wall -O2
 CC=gcc
+CFLAGS=-W -Wall -O2
 
 OBJS= ccache.o mdfour.o hash.o execute.o util.o args.o stats.o cleanup.o
 HEADERS = ccache.h mdfour.h
index 2574a0d8cabf2ba7d71656b6ab09ce67f899e4f3..75b88cefd01429d4f925ad391dcdc3787eec106e 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -576,7 +576,7 @@ static void ccache(int argc, char *argv[])
 
 static void usage(void)
 {
-       printf("ccache, a compiler cache\n");
+       printf("ccache, a compiler cache. Version %s\n", CCACHE_VERSION);
        printf("Copyright Andrew Tridgell, 2002\n\n");
        
        printf("Usage:\n");
@@ -585,12 +585,13 @@ static void usage(void)
        printf("\tcompiler [compile options]    (via symbolic link)\n");
        printf("\nOptions:\n");
 
-       printf("-h                      this help page\n");
        printf("-s                      show statistics summary\n");
        printf("-h                      zero statistics\n");
        printf("-c                      run a cache cleanup\n");
        printf("-F <maxfiles>           set maximum files in cache\n");
        printf("-M <maxsize>            set maximum size of cache (use G, M or K)\n");
+       printf("-h                      this help page\n");
+       printf("-V                      print version number\n");
 }
 
 /* the main program when not doing a compile */
@@ -600,8 +601,12 @@ static int ccache_main(int argc, char *argv[])
        int c;
        size_t v;
 
-       while ((c = getopt(argc, argv, "hszcF:M:")) != -1) {
+       while ((c = getopt(argc, argv, "hszcF:M:V")) != -1) {
                switch (c) {
+               case 'V':
+                       printf("ccache version %s\n", CCACHE_VERSION);
+                       exit(0);
+
                case 'h':
                        usage();
                        exit(0);
index 6aaee51cc523ab9eb1ff571cedfd3a68bbdf4bb3..354b47324b9b1d8db286643e2e4a5586f887537b 100644 (file)
--- a/ccache.h
+++ b/ccache.h
@@ -1,5 +1,6 @@
 #define _GNU_SOURCE
 
+#define CCACHE_VERSION "1.0"
 
 #include <stdio.h>
 #include <unistd.h>