From: Andrew Tridgell Date: Sat, 30 Mar 2002 12:35:26 +0000 (+0100) Subject: added a version number X-Git-Tag: v1.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65f932325ba1945f8d2a232a84ab7944ae9db7f7;p=thirdparty%2Fccache.git added a version number --- diff --git a/Makefile b/Makefile index 49fb4c9c1..d91b90ca8 100644 --- 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 diff --git a/ccache.c b/ccache.c index 2574a0d8c..75b88cefd 100644 --- 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 set maximum files in cache\n"); printf("-M 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); diff --git a/ccache.h b/ccache.h index 6aaee51cc..354b47324 100644 --- a/ccache.h +++ b/ccache.h @@ -1,5 +1,6 @@ #define _GNU_SOURCE +#define CCACHE_VERSION "1.0" #include #include