]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
feat: Rename --directory option to --dir
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 10 Aug 2021 18:04:39 +0000 (20:04 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 10 Aug 2021 18:04:39 +0000 (20:04 +0200)
Other options use abbreviated forms (e.g. “config” and “max”), so this
makes things more consistent.

doc/MANUAL.adoc
src/core/mainoptions.cpp

index a1a1532d66f39cd7925d6a3be0401c30e8d5e550..5d634a6450e0d3c39ec7814718a8b89e559d918f 100644 (file)
@@ -91,12 +91,12 @@ compiler's documentation.
     the default. Using this option has the same effect as setting the
     environment variable `CCACHE_CONFIGPATH` temporarily.
 
-*-d*, *--directory* _PATH_::
+*-d*, *--dir* _PATH_::
 
     Let the command line options operate on cache directory _PATH_ instead of
     the default. For example, to show statistics for a cache directory at
-    `/shared/ccache` you can run `ccache -d /shared/ccache -s`. Using this
-    option has the same effect as setting the environment variable `CCACHE_DIR`
+    `/shared/ccache` you can run `ccache -d /shared/ccache -s`. Using this option
+    has the same effect as setting the environment variable `CCACHE_DIR`
     temporarily.
 
 *--evict-older-than* _AGE_::
@@ -414,7 +414,7 @@ project2 will be a different absolute path.
 See also _<<Location of the primary configuration file>>_.
 +
 If you want to use another `CCACHE_DIR` value temporarily for one ccache
-invocation you can use the `-d`/`--directory` command line option instead.
+invocation you can use the `-d`/`--dir` command line option instead.
 
 [#config_compiler]
 *compiler* (*CCACHE_COMPILER* or (deprecated) *CCACHE_CC*)::
index f95c9e78fc0c495da2b130c6e6336725ede0ee6b..2c301d970aef30cd81eb41390414445b72eaeabc 100644 (file)
@@ -88,7 +88,7 @@ Common options:
     -C, --clear                clear the cache completely (except configuration)
         --config-path PATH     operate on configuration file PATH instead of the
                                default
-    -d, --directory PATH       operate on cache directory PATH instead of the
+    -d, --dir PATH             operate on cache directory PATH instead of the
                                default
         --evict-older-than AGE remove files older than AGE (unsigned integer
                                with a d (days) or s (seconds) suffix)
@@ -276,7 +276,8 @@ const option long_options[] = {
   {"cleanup", no_argument, nullptr, 'c'},
   {"clear", no_argument, nullptr, 'C'},
   {"config-path", required_argument, nullptr, CONFIG_PATH},
-  {"directory", required_argument, nullptr, 'd'},
+  {"dir", required_argument, nullptr, 'd'},
+  {"directory", required_argument, nullptr, 'd'}, // backward compatibility
   {"dump-manifest", required_argument, nullptr, DUMP_MANIFEST},
   {"dump-result", required_argument, nullptr, DUMP_RESULT},
   {"evict-older-than", required_argument, nullptr, EVICT_OLDER_THAN},
@@ -317,7 +318,7 @@ process_main_options(int argc, const char* const* argv)
     const std::string arg = optarg ? optarg : std::string();
 
     switch (c) {
-    case 'd': // --directory
+    case 'd': // --dir
       Util::setenv("CCACHE_DIR", arg);
       break;
 
@@ -350,7 +351,7 @@ process_main_options(int argc, const char* const* argv)
 
     switch (c) {
     case CONFIG_PATH:
-    case 'd': // --directory
+    case 'd': // --dir
     case TRIM_MAX_SIZE:
     case TRIM_METHOD:
       // Already handled in the first pass.