Skip to content

Commit

Permalink
Update CLI documentation for --cache-dir (#8627)
Browse files Browse the repository at this point in the history
Refs:
- #8626

## Summary

Current documentation incorrectly suggests that the macOS cache
directory location is `$HOME/Library/Caches/uv`, but that changed in:

- #5806

Updates docs to say this instead:

> <p>Defaults to <code>$HOME/.cache/uv</code> on macOS,
<code>$XDG_CACHE_HOME/uv</code> or <code>$HOME/.cache/uv</code> on
Linux, and <code>%LOCALAPPDATA%\uv\cache</code> on Windows. The <code>uv
cache dir</code> command will show the location of the cache
directory.</p>

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
  • Loading branch information
simonw and charliermarsh authored Oct 28, 2024
1 parent e7c3ef1 commit 572840d
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 45 deletions.
6 changes: 4 additions & 2 deletions crates/uv-cache/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ pub struct CacheArgs {

/// Path to the cache directory.
///
/// Defaults to `$HOME/Library/Caches/uv` on macOS, `$XDG_CACHE_HOME/uv` or `$HOME/.cache/uv` on
/// Linux, and `%LOCALAPPDATA%\uv\cache` on Windows.
/// Defaults to `$XDG_CACHE_HOME/uv` or `$HOME/.cache/uv` on macOS and Linux, and
/// `%LOCALAPPDATA%\uv\cache` on Windows.
///
/// To view the location of the cache directory, run `uv cache dir`.
#[arg(global = true, long, env = EnvVars::UV_CACHE_DIR)]
pub cache_dir: Option<PathBuf>,
}
Expand Down
12 changes: 8 additions & 4 deletions crates/uv/tests/it/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,10 @@ fn help_subcommand() {
--cache-dir [CACHE_DIR]
Path to the cache directory.
Defaults to `$HOME/Library/Caches/uv` on macOS, `$XDG_CACHE_HOME/uv` or `$HOME/.cache/uv`
on Linux, and `%LOCALAPPDATA%/uv/cache` on Windows.
Defaults to `$XDG_CACHE_HOME/uv` or `$HOME/.cache/uv` on macOS and Linux, and
`%LOCALAPPDATA%/uv/cache` on Windows.
To view the location of the cache directory, run `uv cache dir`.
[env: UV_CACHE_DIR=]
Expand Down Expand Up @@ -447,8 +449,10 @@ fn help_subsubcommand() {
--cache-dir [CACHE_DIR]
Path to the cache directory.
Defaults to `$HOME/Library/Caches/uv` on macOS, `$XDG_CACHE_HOME/uv` or `$HOME/.cache/uv`
on Linux, and `%LOCALAPPDATA%/uv/cache` on Windows.
Defaults to `$XDG_CACHE_HOME/uv` or `$HOME/.cache/uv` on macOS and Linux, and
`%LOCALAPPDATA%/uv/cache` on Windows.
To view the location of the cache directory, run `uv cache dir`.
[env: UV_CACHE_DIR=]
Expand Down
Loading

0 comments on commit 572840d

Please sign in to comment.