From: Joel Rosdahl Date: Tue, 10 Aug 2021 18:04:39 +0000 (+0200) Subject: feat: Rename --directory option to --dir X-Git-Tag: v4.4~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a239db94052c371a7483b81257632791fa4c57c6;p=thirdparty%2Fccache.git feat: Rename --directory option to --dir Other options use abbreviated forms (e.g. “config” and “max”), so this makes things more consistent. --- diff --git a/doc/MANUAL.adoc b/doc/MANUAL.adoc index a1a1532d6..5d634a645 100644 --- a/doc/MANUAL.adoc +++ b/doc/MANUAL.adoc @@ -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 _<>_. + 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*):: diff --git a/src/core/mainoptions.cpp b/src/core/mainoptions.cpp index f95c9e78f..2c301d970 100644 --- a/src/core/mainoptions.cpp +++ b/src/core/mainoptions.cpp @@ -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.