Skip to content

Commit 2abe56a

Browse files
authored
Clarify --project flag help text to indicate project discovery (#16965)
Clarify `--project` flag help text to indicate project discovery Update the help text for `--project` from "Run the command within the given project directory" to "Discover a project in the given directory" to better reflect its actual behavior. The `--project` flag affects file discovery (pyproject.toml, uv.toml, etc.) but does not change the working directory. Users should use `--directory` for changing the working directory. Fixes #16718
1 parent 2f553bf commit 2abe56a

3 files changed

Lines changed: 59 additions & 59 deletions

File tree

crates/uv-cli/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ pub struct GlobalArgs {
345345
#[arg(global = true, long, env = EnvVars::UV_WORKING_DIR)]
346346
pub directory: Option<PathBuf>,
347347

348-
/// Run the command within the given project directory.
348+
/// Discover a project in the given directory.
349349
///
350350
/// All `pyproject.toml`, `uv.toml`, and `.python-version` files will be discovered by walking
351351
/// up the directory tree from the project root, as will the project's virtual environment

crates/uv/tests/it/help.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fn help() {
6868
--directory <DIRECTORY>
6969
Change to the given directory prior to running the command [env: UV_WORKING_DIR=]
7070
--project <PROJECT>
71-
Run the command within the given project directory [env: UV_PROJECT=]
71+
Discover a project in the given directory [env: UV_PROJECT=]
7272
--config-file <CONFIG_FILE>
7373
The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=]
7474
--no-config
@@ -149,7 +149,7 @@ fn help_flag() {
149149
--directory <DIRECTORY>
150150
Change to the given directory prior to running the command [env: UV_WORKING_DIR=]
151151
--project <PROJECT>
152-
Run the command within the given project directory [env: UV_PROJECT=]
152+
Discover a project in the given directory [env: UV_PROJECT=]
153153
--config-file <CONFIG_FILE>
154154
The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=]
155155
--no-config
@@ -229,7 +229,7 @@ fn help_short_flag() {
229229
--directory <DIRECTORY>
230230
Change to the given directory prior to running the command [env: UV_WORKING_DIR=]
231231
--project <PROJECT>
232-
Run the command within the given project directory [env: UV_PROJECT=]
232+
Discover a project in the given directory [env: UV_PROJECT=]
233233
--config-file <CONFIG_FILE>
234234
The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=]
235235
--no-config
@@ -419,7 +419,7 @@ fn help_subcommand() {
419419
[env: UV_WORKING_DIR=]
420420
421421
--project <PROJECT>
422-
Run the command within the given project directory.
422+
Discover a project in the given directory.
423423
424424
All `pyproject.toml`, `uv.toml`, and `.python-version` files will be discovered by walking
425425
up the directory tree from the project root, as will the project's virtual environment
@@ -692,7 +692,7 @@ fn help_subsubcommand() {
692692
[env: UV_WORKING_DIR=]
693693
694694
--project <PROJECT>
695-
Run the command within the given project directory.
695+
Discover a project in the given directory.
696696
697697
All `pyproject.toml`, `uv.toml`, and `.python-version` files will be discovered by walking
698698
up the directory tree from the project root, as will the project's virtual environment
@@ -783,7 +783,7 @@ fn help_flag_subcommand() {
783783
--directory <DIRECTORY>
784784
Change to the given directory prior to running the command [env: UV_WORKING_DIR=]
785785
--project <PROJECT>
786-
Run the command within the given project directory [env: UV_PROJECT=]
786+
Discover a project in the given directory [env: UV_PROJECT=]
787787
--config-file <CONFIG_FILE>
788788
The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=]
789789
--no-config
@@ -864,7 +864,7 @@ fn help_flag_subsubcommand() {
864864
--directory <DIRECTORY>
865865
Change to the given directory prior to running the command [env: UV_WORKING_DIR=]
866866
--project <PROJECT>
867-
Run the command within the given project directory [env: UV_PROJECT=]
867+
Discover a project in the given directory [env: UV_PROJECT=]
868868
--config-file <CONFIG_FILE>
869869
The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=]
870870
--no-config
@@ -1026,7 +1026,7 @@ fn help_with_global_option() {
10261026
--directory <DIRECTORY>
10271027
Change to the given directory prior to running the command [env: UV_WORKING_DIR=]
10281028
--project <PROJECT>
1029-
Run the command within the given project directory [env: UV_PROJECT=]
1029+
Discover a project in the given directory [env: UV_PROJECT=]
10301030
--config-file <CONFIG_FILE>
10311031
The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=]
10321032
--no-config
@@ -1149,7 +1149,7 @@ fn help_with_no_pager() {
11491149
--directory <DIRECTORY>
11501150
Change to the given directory prior to running the command [env: UV_WORKING_DIR=]
11511151
--project <PROJECT>
1152-
Run the command within the given project directory [env: UV_PROJECT=]
1152+
Discover a project in the given directory [env: UV_PROJECT=]
11531153
--config-file <CONFIG_FILE>
11541154
The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=]
11551155
--no-config

0 commit comments

Comments
 (0)