diff --git a/src/bin/cargo/commands/install.rs b/src/bin/cargo/commands/install.rs index 6f903479a598..4275aa700757 100644 --- a/src/bin/cargo/commands/install.rs +++ b/src/bin/cargo/commands/install.rs @@ -18,7 +18,8 @@ pub fn cli() -> Command { .about("Install a Rust binary. Default location is $HOME/.cargo/bin") .arg( Arg::new("crate") - .value_name("CRATE") + .value_name("CRATE[@]") + .help("Select the package from the given source") .value_parser(parse_crate) .num_args(0..), ) diff --git a/tests/testsuite/cargo_install/help/stdout.log b/tests/testsuite/cargo_install/help/stdout.log index ebc29bc8dd3d..3a6fe5f824ed 100644 --- a/tests/testsuite/cargo_install/help/stdout.log +++ b/tests/testsuite/cargo_install/help/stdout.log @@ -1,9 +1,9 @@ Install a Rust binary. Default location is $HOME/.cargo/bin -Usage: cargo install [OPTIONS] [CRATE]... +Usage: cargo install [OPTIONS] [CRATE[@]]... Arguments: - [CRATE]... + [CRATE[@]]... Select the package from the given source Options: --version Specify a version to install diff --git a/tests/testsuite/install.rs b/tests/testsuite/install.rs index 905d3c604351..0da4a57cc276 100644 --- a/tests/testsuite/install.rs +++ b/tests/testsuite/install.rs @@ -1614,7 +1614,7 @@ fn inline_version_without_name() { cargo_process("install @0.1.1") .with_status(1) .with_stderr( - "error: invalid value '@0.1.1' for '[CRATE]...': missing crate name before '@' + "error: invalid value '@0.1.1' for '[CRATE[@]]...': missing crate name before '@' For more information, try '--help'. ", @@ -1844,7 +1844,9 @@ fn install_empty_argument() { cargo_process("install") .arg("") .with_status(1) - .with_stderr_contains("[ERROR] invalid value '' for '[CRATE]...': crate name is empty") + .with_stderr_contains( + "[ERROR] invalid value '' for '[CRATE[@]]...': crate name is empty", + ) .run(); } @@ -2455,7 +2457,7 @@ error: unexpected argument '--release' found tip: `--release` is the default for `cargo install`; instead `--debug` is supported -Usage: cargo[EXE] install [OPTIONS] [CRATE]... +Usage: cargo[EXE] install [OPTIONS] [CRATE[@]]... For more information, try '--help'. ",