1
diff --git a/ccache.1 b/ccache.1
2
index 9d1cbcd..87b3a85 100644
5
@@ -23,14 +23,14 @@ Here is a summary of the options to ccache\&.
9
--s show statistics summary
11
--c run a cache cleanup
12
--C clear the cache completely
13
--F <maxfiles> set maximum files in cache
14
--M <maxsize> set maximum size of cache (use G, M or K)
16
--V print version number
17
+\-s, \-\-show-stats show statistics summary
18
+\-z, \-\-zero-stats zero statistics
19
+\-c, \-\-cleanup run a cache cleanup
20
+\-C, \-\-clear clear the cache completely
21
+\-F <n>, \-\-max-files=<n> set maximum files in cache
22
+\-M <n>, \-\-max-size=<n> set maximum size of cache (use G, M or K)
23
+\-h, \-\-help this help page
24
+\-V, \-\-version print version number
28
@@ -43,22 +43,22 @@ invoked as a compiler none of these options apply\&. In that case your
29
normal compiler options apply and you should refer to your compilers
33
+.IP "\fB-h, --help\fP"
34
Print a options summary page
37
+.IP "\fB-s, --show-stats\fP"
38
Print the current statistics summary for the cache\&. The
39
statistics are stored spread across the subdirectories of the
40
cache\&. Using "ccache -s" adds up the statistics across all
41
subdirectories and prints the totals\&.
44
+.IP "\fB-z, --zero-stats\fP"
45
Zero the cache statistics\&.
48
+.IP "\fB-V, --version\fP"
49
Print the ccache version number
52
+.IP "\fB-c, --cleanup\fP"
53
Clean the cache and re-calculate the cache file count and
54
size totals\&. Normally the -c option should not be necessary as ccache
55
keeps the cache below the specified limits at runtime and keeps
56
@@ -66,16 +66,16 @@ statistics up to date on each compile\&. This option is mostly useful
57
if you manually modify the cache contents or believe that the cache
58
size statistics may be inaccurate\&.
61
+.IP "\fB-C, --clear\fP"
62
Clear the entire cache, removing all cached files\&.
64
-.IP "\fB-F maxfiles\fP"
65
+.IP "\fB-F <maxfiles>, --max-files=<maxfiles>\fP"
66
This sets the maximum number of files allowed in
67
the cache\&. The value is stored inside the cache directory and applies
68
to all future compiles\&. Due to the way the value is stored the actual
69
value used is always rounded down to the nearest multiple of 16\&.
71
-.IP "\fB-M maxsize\fP"
72
+.IP "\fB-M <maxsize>, --max-size=<maxsize>\fP"
73
This sets the maximum cache size\&. You can specify
74
a value in gigabytes, megabytes or kilobytes by appending a G, M or K
75
to the value\&. The default is gigabytes\&. The actual value stored is
76
diff --git a/ccache.c b/ccache.c
77
index f6be1bc..f9b7b82 100644
86
/* the base cache directory */
87
char *cache_dir = NULL;
88
@@ -911,14 +912,14 @@ static void usage(void)
89
printf("\tcompiler [compile options] (via symbolic link)\n");
90
printf("\nOptions:\n");
92
- printf("-s show statistics summary\n");
93
- printf("-z zero statistics\n");
94
- printf("-c run a cache cleanup\n");
95
- printf("-C clear the cache completely\n");
96
- printf("-F <maxfiles> set maximum files in cache\n");
97
- printf("-M <maxsize> set maximum size of cache (use G, M or K)\n");
98
- printf("-h this help page\n");
99
- printf("-V print version number\n");
100
+ printf("-s, --show-stats show statistics summary\n");
101
+ printf("-z, --zero-stats zero statistics\n");
102
+ printf("-c, --cleanup run a cache cleanup\n");
103
+ printf("-C, --clear clear the cache completely\n");
104
+ printf("-F <n>, --max-files=<n> set maximum files in cache\n");
105
+ printf("-M <n>, --max-size=<n> set maximum size of cache (use G, M or K)\n");
106
+ printf("-h, --help this help page\n");
107
+ printf("-V, --version print version number\n");
110
static void check_cache_dir(void)
111
@@ -934,7 +935,21 @@ static int ccache_main(int argc, char *argv[])
115
- while ((c = getopt(argc, argv, "hszcCF:M:V")) != -1) {
116
+ static struct option long_options[] =
118
+ {"show-stats", no_argument, 0, 's'},
119
+ {"zero-stats", no_argument, 0, 'z'},
120
+ {"cleanup", no_argument, 0, 'c'},
121
+ {"clear", no_argument, 0, 'C'},
122
+ {"max-files", required_argument, 0, 'F'},
123
+ {"max-size", required_argument, 0, 'M'},
124
+ {"help", no_argument, 0, 'h'},
125
+ {"version", no_argument, 0, 'V'},
128
+ int option_index = 0;
130
+ while ((c = getopt_long(argc, argv, "hszcCF:M:V", long_options, &option_index)) != -1) {
133
printf("ccache version %s\n", CCACHE_VERSION);