Skip to content

Commit

Permalink
fix(help): Clarify install's positional
Browse files Browse the repository at this point in the history
- That a version is accepted
- That you are selecting from the source a package which led to part of
  the confusion in rust-lang#4830

I wonder if we should rename our `CRATE` value names to `PKG`/`PACKAGE`
  • Loading branch information
epage committed Oct 17, 2023
1 parent 3e8d49c commit 0e59944
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/bin/cargo/commands/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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[@<VER>]")
.help("Select the package from the given source")
.value_parser(parse_crate)
.num_args(0..),
)
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_install/help/stdout.log
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Install a Rust binary. Default location is $HOME/.cargo/bin

Usage: cargo install [OPTIONS] [CRATE]...
Usage: cargo install [OPTIONS] [CRATE[@<VER>]]...

Arguments:
[CRATE]...
[CRATE[@<VER>]]... Select the package from the given source

Options:
--version <VERSION> Specify a version to install
Expand Down

0 comments on commit 0e59944

Please sign in to comment.