Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ pub struct GlobalArgs {
/// Relative paths are resolved with the given directory as the base.
///
/// See `--project` to only change the project root directory.
#[arg(global = true, long)]
#[arg(global = true, long, env = EnvVars::UV_WORKING_DIRECTORY)]
pub directory: Option<PathBuf>,

/// Run the command within the given project directory.
Expand Down
3 changes: 3 additions & 0 deletions crates/uv-static/src/env_vars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,9 @@ impl EnvVars {
/// Equivalent to the `--project` command-line argument.
pub const UV_PROJECT: &'static str = "UV_PROJECT";

/// Equivalent to the `--directory` command-line argument.
pub const UV_WORKING_DIRECTORY: &'static str = "UV_WORKING_DIRECTORY";

/// Disable GitHub-specific requests that allow uv to skip `git fetch` in some circumstances.
pub const UV_NO_GITHUB_FAST_PATH: &'static str = "UV_NO_GITHUB_FAST_PATH";

Expand Down
18 changes: 11 additions & 7 deletions crates/uv/tests/it/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fn help() {
--no-progress
Hide all progress outputs [env: UV_NO_PROGRESS=]
--directory <DIRECTORY>
Change to the given directory prior to running the command
Change to the given directory prior to running the command [env: UV_WORKING_DIRECTORY=]
--project <PROJECT>
Run the command within the given project directory [env: UV_PROJECT=]
--config-file <CONFIG_FILE>
Expand Down Expand Up @@ -147,7 +147,7 @@ fn help_flag() {
--no-progress
Hide all progress outputs [env: UV_NO_PROGRESS=]
--directory <DIRECTORY>
Change to the given directory prior to running the command
Change to the given directory prior to running the command [env: UV_WORKING_DIRECTORY=]
--project <PROJECT>
Run the command within the given project directory [env: UV_PROJECT=]
--config-file <CONFIG_FILE>
Expand Down Expand Up @@ -227,7 +227,7 @@ fn help_short_flag() {
--no-progress
Hide all progress outputs [env: UV_NO_PROGRESS=]
--directory <DIRECTORY>
Change to the given directory prior to running the command
Change to the given directory prior to running the command [env: UV_WORKING_DIRECTORY=]
--project <PROJECT>
Run the command within the given project directory [env: UV_PROJECT=]
--config-file <CONFIG_FILE>
Expand Down Expand Up @@ -415,6 +415,8 @@ fn help_subcommand() {
Relative paths are resolved with the given directory as the base.

See `--project` to only change the project root directory.

[env: UV_WORKING_DIRECTORY=]

--project <PROJECT>
Run the command within the given project directory.
Expand Down Expand Up @@ -676,6 +678,8 @@ fn help_subsubcommand() {
Relative paths are resolved with the given directory as the base.

See `--project` to only change the project root directory.

[env: UV_WORKING_DIRECTORY=]

--project <PROJECT>
Run the command within the given project directory.
Expand Down Expand Up @@ -767,7 +771,7 @@ fn help_flag_subcommand() {
--no-progress
Hide all progress outputs [env: UV_NO_PROGRESS=]
--directory <DIRECTORY>
Change to the given directory prior to running the command
Change to the given directory prior to running the command [env: UV_WORKING_DIRECTORY=]
--project <PROJECT>
Run the command within the given project directory [env: UV_PROJECT=]
--config-file <CONFIG_FILE>
Expand Down Expand Up @@ -846,7 +850,7 @@ fn help_flag_subsubcommand() {
--no-progress
Hide all progress outputs [env: UV_NO_PROGRESS=]
--directory <DIRECTORY>
Change to the given directory prior to running the command
Change to the given directory prior to running the command [env: UV_WORKING_DIRECTORY=]
--project <PROJECT>
Run the command within the given project directory [env: UV_PROJECT=]
--config-file <CONFIG_FILE>
Expand Down Expand Up @@ -1008,7 +1012,7 @@ fn help_with_global_option() {
--no-progress
Hide all progress outputs [env: UV_NO_PROGRESS=]
--directory <DIRECTORY>
Change to the given directory prior to running the command
Change to the given directory prior to running the command [env: UV_WORKING_DIRECTORY=]
--project <PROJECT>
Run the command within the given project directory [env: UV_PROJECT=]
--config-file <CONFIG_FILE>
Expand Down Expand Up @@ -1131,7 +1135,7 @@ fn help_with_no_pager() {
--no-progress
Hide all progress outputs [env: UV_NO_PROGRESS=]
--directory <DIRECTORY>
Change to the given directory prior to running the command
Change to the given directory prior to running the command [env: UV_WORKING_DIRECTORY=]
--project <PROJECT>
Run the command within the given project directory [env: UV_PROJECT=]
--config-file <CONFIG_FILE>
Expand Down
Loading
Loading