From ef948619eebae189b08c1a31965687d4053b7e03 Mon Sep 17 00:00:00 2001 From: eth3lbert Date: Wed, 14 Aug 2024 00:21:44 +0800 Subject: [PATCH] Hide python options in `uv tool list` help (#6003) ## Summary Closes #5982 . ## Test Plan ``` cargo run tool list --help ``` --------- Co-authored-by: Zanie Blue --- crates/uv-cli/src/lib.rs | 6 ++++++ crates/uv/src/settings.rs | 2 +- docs/reference/cli.md | 17 ----------------- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 07b4777c3cfc..442188c31e45 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -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, + #[arg(long, hide = true)] + pub no_python_downloads: bool, } #[derive(Args)] diff --git a/crates/uv/src/settings.rs b/crates/uv/src/settings.rs index 10da1ee3783f..7124da598228 100644 --- a/crates/uv/src/settings.rs +++ b/crates/uv/src/settings.rs @@ -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) -> Self { - let ToolListArgs { show_paths } = args; + let ToolListArgs { show_paths, .. } = args; Self { show_paths } } diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 7a95de318c6e..fd459be20553 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -2549,27 +2549,10 @@ uv tool list [OPTIONS]

For example, spinners or progress bars.

-
--no-python-downloads

Disable automatic downloads of Python

-
--offline

Disable network access.

When disabled, uv will only use locally cached data and locally available files.

-
--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

- -

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.

- -

Possible values:

- -
    -
  • only-managed: Only use managed Python installations; never use system Python installations
  • - -
  • managed: Prefer managed Python installations over system Python installations
  • - -
  • system: Prefer system Python installations over managed Python installations
  • - -
  • only-system: Only use system Python installations; never use managed Python installations
  • -
--quiet, -q

Do not print any output

--show-paths

Whether to display the path to each tool environment and installed executable