Skip to content

Commit

Permalink
Hide python options in uv tool list help (#6003)
Browse files Browse the repository at this point in the history
## Summary

Closes #5982 .

## Test Plan

```
cargo run tool list --help
```

---------

Co-authored-by: Zanie Blue <[email protected]>
  • Loading branch information
eth3lbert and zanieb authored Aug 13, 2024
1 parent d203140 commit ef94861
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
6 changes: 6 additions & 0 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2815,6 +2815,12 @@ pub struct ToolListArgs {
/// Whether to display the path to each tool environment and installed executable.
#[arg(long)]
pub show_paths: bool,

// Hide unused global Python options.
#[arg(long, hide = true)]
pub python_preference: Option<PythonPreference>,
#[arg(long, hide = true)]
pub no_python_downloads: bool,
}

#[derive(Args)]
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ impl ToolListSettings {
/// Resolve the [`ToolListSettings`] from the CLI and filesystem configuration.
#[allow(clippy::needless_pass_by_value)]
pub(crate) fn resolve(args: ToolListArgs, _filesystem: Option<FilesystemOptions>) -> Self {
let ToolListArgs { show_paths } = args;
let ToolListArgs { show_paths, .. } = args;

Self { show_paths }
}
Expand Down
17 changes: 0 additions & 17 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2549,27 +2549,10 @@ uv tool list [OPTIONS]

<p>For example, spinners or progress bars.</p>

</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p>

</dd><dt><code>--offline</code></dt><dd><p>Disable network access.</p>

<p>When disabled, uv will only use locally cached data and locally available files.</p>

</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>

<p>By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.</p>

<p>Possible values:</p>

<ul>
<li><code>only-managed</code>: Only use managed Python installations; never use system Python installations</li>

<li><code>managed</code>: Prefer managed Python installations over system Python installations</li>

<li><code>system</code>: Prefer system Python installations over managed Python installations</li>

<li><code>only-system</code>: Only use system Python installations; never use managed Python installations</li>
</ul>
</dd><dt><code>--quiet</code>, <code>-q</code></dt><dd><p>Do not print any output</p>

</dd><dt><code>--show-paths</code></dt><dd><p>Whether to display the path to each tool environment and installed executable</p>
Expand Down

0 comments on commit ef94861

Please sign in to comment.