]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Clarify cache size limit options' semantics
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 6 Jan 2010 13:39:39 +0000 (14:39 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 6 Jan 2010 21:23:10 +0000 (22:23 +0100)
NEWS
ccache.c
ccache.yo

diff --git a/NEWS b/NEWS
index afbd3cd4be4d7ef50990d2437811e4c38f344587..0a9884a79ae5cf29091f5b0579b9920ba4cde782 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -50,6 +50,8 @@ New features and improvements:
 
   - Added installcheck and distcheck make targets.
 
+  - Clarified cache size limit options' semantics
+
 Bug fixes:
 
   - Fixed build on FreeBSD.
index 8378c4959ac09eef92bb30df9a27e52fd7fe65ed..70729f1398033ee4bf957199546220b9a4b8f2e1 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -1606,8 +1606,8 @@ static void usage(void)
        printf("-z, --zero-stats         zero statistics\n");
        printf("-c, --cleanup            run a cache cleanup\n");
        printf("-C, --clear              clear the cache completely\n");
-       printf("-F <n>, --max-files=<n>  set maximum files in cache\n");
-       printf("-M <n>, --max-size=<n>   set maximum size of cache (use G, M or K)\n");
+       printf("-F <n>, --max-files=<n>  set maximum number of files in cache (0: no limit)\n");
+       printf("-M <n>, --max-size=<n>   set maximum size of cache (use G, M or K; 0: no limit)\n");
        printf("-h, --help               this help page\n");
        printf("-V, --version            print version number\n");
 }
@@ -1677,7 +1677,11 @@ static int ccache_main(int argc, char *argv[])
                        check_cache_dir();
                        v = atoi(optarg);
                        if (stats_set_limits(v, -1) == 0) {
-                               printf("Set cache file limit to %u\n", (unsigned)v);
+                               if (v == 0) {
+                                       printf("Unset cache file limit\n");
+                               } else {
+                                       printf("Set cache file limit to %u\n", (unsigned)v);
+                               }
                        } else {
                                printf("Could not set cache file limit.\n");
                                exit(1);
@@ -1688,7 +1692,11 @@ static int ccache_main(int argc, char *argv[])
                        check_cache_dir();
                        v = value_units(optarg);
                        if (stats_set_limits(-1, v) == 0) {
-                               printf("Set cache size limit to %uk\n", (unsigned)v);
+                               if (v == 0) {
+                                       printf("Unset cache size limit\n");
+                               } else {
+                                       printf("Set cache size limit to %uk\n", (unsigned)v);
+                               }
                        } else {
                                printf("Could not set cache size limit.\n");
                                exit(1);
index 9d76600b2fc7098291cced5e2b3e95bcff8945d8..2f2a034c11e7cceac51a032ab7e836cc897af7cf 100644 (file)
--- a/ccache.yo
+++ b/ccache.yo
@@ -24,8 +24,8 @@ verb(
 -z, --zero-stats        zero statistics
 -c, --cleanup           run a cache cleanup
 -C, --clear             clear the cache completely
--F <n>, --max-files=<n> set maximum number of files in cache
--M <n>, --max-size=<n>  set maximum size of cache (use G, M or K)
+-F <n>, --max-files=<n> set maximum number of files in cache (0: no limit)
+-M <n>, --max-size=<n>  set maximum size of cache (use G, M or K; 0: no limit)
 -h, --help              this help page
 -V, --version           print version number
 )