mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
fix(help): Clarify install's positional
- That a version is accepted - That you are selecting from the source a package which led to part of the confusion in #4830 I wonder if we should rename our `CRATE` value names to `PKG`/`PACKAGE`
This commit is contained in:
parent
99f917a67e
commit
5f0596941f
@ -18,7 +18,8 @@ pub fn cli() -> Command {
|
|||||||
.about("Install a Rust binary. Default location is $HOME/.cargo/bin")
|
.about("Install a Rust binary. Default location is $HOME/.cargo/bin")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("crate")
|
Arg::new("crate")
|
||||||
.value_name("CRATE")
|
.value_name("CRATE[@<VER>]")
|
||||||
|
.help("Select the package from the given source")
|
||||||
.value_parser(parse_crate)
|
.value_parser(parse_crate)
|
||||||
.num_args(0..),
|
.num_args(0..),
|
||||||
)
|
)
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
Install a Rust binary. Default location is $HOME/.cargo/bin
|
Install a Rust binary. Default location is $HOME/.cargo/bin
|
||||||
|
|
||||||
Usage: cargo[EXE] install [OPTIONS] [CRATE]...
|
Usage: cargo[EXE] install [OPTIONS] [CRATE[@<VER>]]...
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
[CRATE]...
|
[CRATE[@<VER>]]... Select the package from the given source
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
--version <VERSION> Specify a version to install
|
--version <VERSION> Specify a version to install
|
||||||
|
@ -1614,7 +1614,7 @@ fn inline_version_without_name() {
|
|||||||
cargo_process("install @0.1.1")
|
cargo_process("install @0.1.1")
|
||||||
.with_status(1)
|
.with_status(1)
|
||||||
.with_stderr(
|
.with_stderr(
|
||||||
"error: invalid value '@0.1.1' for '[CRATE]...': missing crate name before '@'
|
"error: invalid value '@0.1.1' for '[CRATE[@<VER>]]...': missing crate name before '@'
|
||||||
|
|
||||||
For more information, try '--help'.
|
For more information, try '--help'.
|
||||||
",
|
",
|
||||||
@ -1844,7 +1844,9 @@ fn install_empty_argument() {
|
|||||||
cargo_process("install")
|
cargo_process("install")
|
||||||
.arg("")
|
.arg("")
|
||||||
.with_status(1)
|
.with_status(1)
|
||||||
.with_stderr_contains("[ERROR] invalid value '' for '[CRATE]...': crate name is empty")
|
.with_stderr_contains(
|
||||||
|
"[ERROR] invalid value '' for '[CRATE[@<VER>]]...': crate name is empty",
|
||||||
|
)
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2455,7 +2457,7 @@ error: unexpected argument '--release' found
|
|||||||
|
|
||||||
tip: `--release` is the default for `cargo install`; instead `--debug` is supported
|
tip: `--release` is the default for `cargo install`; instead `--debug` is supported
|
||||||
|
|
||||||
Usage: cargo[EXE] install [OPTIONS] [CRATE]...
|
Usage: cargo[EXE] install [OPTIONS] [CRATE[@<VER>]]...
|
||||||
|
|
||||||
For more information, try '--help'.
|
For more information, try '--help'.
|
||||||
",
|
",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user