From 523c7346741450b692117d04124b31467048c10e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n?= Date: Mon, 3 Apr 2023 12:24:08 +0200 Subject: [PATCH 1/2] Add documentation for conan cache clean --- reference/commands/cache.rst | 37 +++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/reference/commands/cache.rst b/reference/commands/cache.rst index 1edb57e2f2ad..3dd302f7f76d 100644 --- a/reference/commands/cache.rst +++ b/reference/commands/cache.rst @@ -158,9 +158,8 @@ conan cache clean .. code-block:: text $ conan cache clean -h - usage: conan cache clean [-h] [-v [V]] [-s] [-b] [-d] - [-p PACKAGE_QUERY] - pattern + usage: conan cache clean [-h] [-v [V]] [-s] [-b] [-d] [-t] [-p PACKAGE_QUERY] + [pattern] Remove non-critical folders from the cache, like source, build and/or download (.tgz store) ones. @@ -168,16 +167,44 @@ conan cache clean positional arguments: pattern Selection pattern for references to clean - optional arguments: + options: -h, --help show this help message and exit -v [V] Level of detail of the output. Valid options from less verbose to more verbose: -vquiet, -verror, -vwarning, -vnotice, -vstatus, -v or -vverbose, -vv or -vdebug, -vvv or -vtrace - -s, --source Clean source folders -b, --build Clean build folders -d, --download Clean download folders + -t, --temp Clean temporary folders -p PACKAGE_QUERY, --package-query PACKAGE_QUERY Remove only the packages matching a specific query, e.g., os=Windows AND (arch=x86 OR compiler=gcc) + +This command will remove non-critical files that Conan generates in its execution. +It will remove all temporary files, along with all the source, build and download folders +for every matching reference passed in *pattern*, unless a specific flag is supplied. + + +**Examples**: + + +- Remove all non-critical files: + + .. code-block:: text + + $ conan cache clean * + + +- Remove all temporary files: + + .. code-block:: text + + $ conan cache clean * --temp + + +- Remove the download folders for every ``zlib`` recipe + + .. code-block:: text + + $ conan cache clean zlib* --download From 099e7f9ace56fd4ce694288fb768e8dc54566c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n?= Date: Mon, 3 Apr 2023 13:24:58 +0200 Subject: [PATCH 2/2] Address review comments --- reference/commands/cache.rst | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/reference/commands/cache.rst b/reference/commands/cache.rst index f17ec0703ea1..cce99370a4ae 100644 --- a/reference/commands/cache.rst +++ b/reference/commands/cache.rst @@ -167,7 +167,7 @@ conan cache clean positional arguments: pattern Selection pattern for references to clean - options: + optional arguments: -h, --help show this help message and exit -v [V] Level of detail of the output. Valid options from less verbose to more verbose: -vquiet, -verror, -vwarning, @@ -181,9 +181,9 @@ conan cache clean Remove only the packages matching a specific query, e.g., os=Windows AND (arch=x86 OR compiler=gcc) -This command will remove non-critical files that Conan generates in its execution. -It will remove all temporary files, along with all the source, build and download folders -for every matching reference passed in *pattern*, unless a specific flag is supplied. +This command will remove all temporary folders, along with the source, build and download folder +that Conan generates in its execution. It will do so for every matching reference passed in *pattern*, +unless a specific flag is supplied, in which case only the specified folders will be removed. **Examples**: @@ -193,21 +193,28 @@ for every matching reference passed in *pattern*, unless a specific flag is supp .. code-block:: text - $ conan cache clean * + $ conan cache clean "*" - Remove all temporary files: .. code-block:: text - $ conan cache clean * --temp + $ conan cache clean "*" --temp + + +- Remove the download folders for the ``zlib`` recipe: + + .. code-block:: text + + $ conan cache clean "zlib*" --download -- Remove the download folders for every ``zlib`` recipe +- Remove everything but the download folder for the ``zlib`` recipe: .. code-block:: text - $ conan cache clean zlib* --download + $ conan cache clean "*" --source --build --temp conan cache check-integrity