Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for conan cache clean #3145

Merged
merged 3 commits into from
Apr 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 32 additions & 5 deletions reference/commands/cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,26 +158,53 @@ 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.

positional arguments:
pattern Selection pattern for references to clean

optional arguments:
options:
czoido marked this conversation as resolved.
Show resolved Hide resolved
-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.
AbrilRBS marked this conversation as resolved.
Show resolved Hide resolved
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 *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't work for me:

ERROR: Define at least one argument among [--source, --build, --download]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you on the release/2.0 branch? Works fine for me



- 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
AbrilRBS marked this conversation as resolved.
Show resolved Hide resolved