PageRenderTime 79ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/CCache/debian/patches/03_long_options.diff

#
Unknown | 133 lines | 124 code | 9 blank | 0 comment | 0 complexity | 122e7d7a5a03628d67c773a849caf3bc MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. Index: ccache.c
  2. ===================================================================
  3. --- ccache.c (r?Švision 7695)
  4. +++ ccache.c (copie de travail)
  5. @@ -22,6 +22,7 @@
  6. */
  7. #include "ccache.h"
  8. +#include <getopt.h>
  9. /* the base cache directory */
  10. char *cache_dir = NULL;
  11. @@ -885,14 +886,14 @@
  12. printf("\tcompiler [compile options] (via symbolic link)\n");
  13. printf("\nOptions:\n");
  14. - printf("-s show statistics summary\n");
  15. - printf("-z zero statistics\n");
  16. - printf("-c run a cache cleanup\n");
  17. - printf("-C clear the cache completely\n");
  18. - printf("-F <maxfiles> set maximum files in cache\n");
  19. - printf("-M <maxsize> set maximum size of cache (use G, M or K)\n");
  20. - printf("-h this help page\n");
  21. - printf("-V print version number\n");
  22. + printf("-s, --show-stats show statistics summary\n");
  23. + printf("-z, --zero-stats zero statistics\n");
  24. + printf("-c, --cleanup run a cache cleanup\n");
  25. + printf("-C, --clear clear the cache completely\n");
  26. + printf("-F <n>, --max-files=<n> set maximum files in cache\n");
  27. + printf("-M <n>, --max-size=<n> set maximum size of cache (use G, M or K)\n");
  28. + printf("-h, --help this help page\n");
  29. + printf("-V, --version print version number\n");
  30. }
  31. /* the main program when not doing a compile */
  32. @@ -901,7 +902,21 @@
  33. int c;
  34. size_t v;
  35. - while ((c = getopt(argc, argv, "hszcCF:M:V")) != -1) {
  36. + static struct option long_options[] =
  37. + {
  38. + {"show-stats", no_argument, 0, 's'},
  39. + {"zero-stats", no_argument, 0, 'z'},
  40. + {"cleanup", no_argument, 0, 'c'},
  41. + {"clear", no_argument, 0, 'C'},
  42. + {"max-files", required_argument, 0, 'F'},
  43. + {"max-size", required_argument, 0, 'M'},
  44. + {"help", no_argument, 0, 'h'},
  45. + {"version", no_argument, 0, 'V'},
  46. + {0, 0, 0, 0}
  47. + };
  48. + int option_index = 0;
  49. +
  50. + while ((c = getopt_long(argc, argv, "hszcCF:M:V", long_options, &option_index)) != -1) {
  51. switch (c) {
  52. case 'V':
  53. printf("ccache version %s\n", CCACHE_VERSION);
  54. Index: ccache.1
  55. ===================================================================
  56. --- ccache.1 (r?Švision 7695)
  57. +++ ccache.1 (copie de travail)
  58. @@ -23,14 +23,14 @@
  59. .nf
  60. --s show statistics summary
  61. --z zero statistics
  62. --c run a cache cleanup
  63. --C clear the cache completely
  64. --F <maxfiles> set maximum files in cache
  65. --M <maxsize> set maximum size of cache (use G, M or K)
  66. --h this help page
  67. --V print version number
  68. +\-s, \-\-show-stats show statistics summary
  69. +\-z, \-\-zero-stats zero statistics
  70. +\-c, \-\-cleanup run a cache cleanup
  71. +\-C, \-\-clear clear the cache completely
  72. +\-F <n>, \-\-max-files=<n> set maximum files in cache
  73. +\-M <n>, \-\-max-size=<n> set maximum size of cache (use G, M or K)
  74. +\-h, \-\-help this help page
  75. +\-V, \-\-version print version number
  76. .fi
  77. @@ -43,22 +43,22 @@
  78. normal compiler options apply and you should refer to your compilers
  79. documentation\&.
  80. .PP
  81. -.IP "\fB-h\fP"
  82. +.IP "\fB-h, --help\fP"
  83. Print a options summary page
  84. .IP
  85. -.IP "\fB-s\fP"
  86. +.IP "\fB-s, --show-stats\fP"
  87. Print the current statistics summary for the cache\&. The
  88. statistics are stored spread across the subdirectories of the
  89. cache\&. Using "ccache -s" adds up the statistics across all
  90. subdirectories and prints the totals\&.
  91. .IP
  92. -.IP "\fB-z\fP"
  93. +.IP "\fB-z, --zero-stats\fP"
  94. Zero the cache statistics\&.
  95. .IP
  96. -.IP "\fB-V\fP"
  97. +.IP "\fB-V, --version\fP"
  98. Print the ccache version number
  99. .IP
  100. -.IP "\fB-c\fP"
  101. +.IP "\fB-c, --cleanup\fP"
  102. Clean the cache and re-calculate the cache file count and
  103. size totals\&. Normally the -c option should not be necessary as ccache
  104. keeps the cache below the specified limits at runtime and keeps
  105. @@ -66,16 +66,16 @@
  106. if you manually modify the cache contents or believe that the cache
  107. size statistics may be inaccurate\&.
  108. .IP
  109. -.IP "\fB-C\fP"
  110. +.IP "\fB-C, --clear\fP"
  111. Clear the entire cache, removing all cached files\&.
  112. .IP
  113. -.IP "\fB-F maxfiles\fP"
  114. +.IP "\fB-F <maxfiles>, --max-files=<maxfiles>\fP"
  115. This sets the maximum number of files allowed in
  116. the cache\&. The value is stored inside the cache directory and applies
  117. to all future compiles\&. Due to the way the value is stored the actual
  118. value used is always rounded down to the nearest multiple of 16\&.
  119. .IP
  120. -.IP "\fB-M maxsize\fP"
  121. +.IP "\fB-M <maxsize>, --max-size=<maxsize>\fP"
  122. This sets the maximum cache size\&. You can specify
  123. a value in gigabytes, megabytes or kilobytes by appending a G, M or K
  124. to the value\&. The default is gigabytes\&. The actual value stored is