@@ -10,15 +10,36 @@ pub fn cli() -> App {
1010 . arg ( opt ( "quiet" , "No output printed to stdout" ) . short ( "q" ) )
1111 . arg ( Arg :: with_name ( "crate" ) . empty_values ( false ) . multiple ( true ) )
1212 . arg (
13- opt ( "version" , "Specify a version to install from crates.io " )
13+ opt ( "version" , "Specify a version to install" )
1414 . alias ( "vers" )
15- . value_name ( "VERSION" ) ,
15+ . value_name ( "VERSION" )
16+ . requires ( "crate" ) ,
17+ )
18+ . arg (
19+ opt ( "git" , "Git URL to install the specified crate from" )
20+ . value_name ( "URL" )
21+ . conflicts_with_all ( & [ "path" , "registry" ] ) ,
22+ )
23+ . arg (
24+ opt ( "branch" , "Branch to use when installing from git" )
25+ . value_name ( "BRANCH" )
26+ . requires ( "git" ) ,
27+ )
28+ . arg (
29+ opt ( "tag" , "Tag to use when installing from git" )
30+ . value_name ( "TAG" )
31+ . requires ( "git" ) ,
32+ )
33+ . arg (
34+ opt ( "rev" , "Specific commit to use when installing from git" )
35+ . value_name ( "SHA" )
36+ . requires ( "git" ) ,
37+ )
38+ . arg (
39+ opt ( "path" , "Filesystem path to local crate to install" )
40+ . value_name ( "PATH" )
41+ . conflicts_with_all ( & [ "git" , "registry" ] ) ,
1642 )
17- . arg ( opt ( "git" , "Git URL to install the specified crate from" ) . value_name ( "URL" ) )
18- . arg ( opt ( "branch" , "Branch to use when installing from git" ) . value_name ( "BRANCH" ) )
19- . arg ( opt ( "tag" , "Tag to use when installing from git" ) . value_name ( "TAG" ) )
20- . arg ( opt ( "rev" , "Specific commit to use when installing from git" ) . value_name ( "SHA" ) )
21- . arg ( opt ( "path" , "Filesystem path to local crate to install" ) . value_name ( "PATH" ) )
2243 . arg ( opt (
2344 "list" ,
2445 "list all installed packages and their versions" ,
@@ -35,7 +56,12 @@ pub fn cli() -> App {
3556 )
3657 . arg_target_triple ( "Build for the target triple" )
3758 . arg ( opt ( "root" , "Directory to install packages into" ) . value_name ( "DIR" ) )
38- . arg ( opt ( "registry" , "Registry to use" ) . value_name ( "REGISTRY" ) )
59+ . arg (
60+ opt ( "registry" , "Registry to use" )
61+ . value_name ( "REGISTRY" )
62+ . requires ( "crate" )
63+ . conflicts_with_all ( & [ "git" , "path" ] ) ,
64+ )
3965 . after_help (
4066 "\
4167 This command manages Cargo's local set of installed binary crates. Only packages
@@ -46,10 +72,10 @@ configuration key, and finally the home directory (which is either
4672`$CARGO_HOME` if set or `$HOME/.cargo` by default).
4773
4874There are multiple sources from which a crate can be installed. The default
49- location is crates.io but the `--git` and `--path` flags can change this source.
50- If the source contains more than one package (such as crates.io or a git
51- repository with multiple crates) the `<crate>` argument is required to indicate
52- which crate should be installed.
75+ location is crates.io but the `--git`, `--path`, and `registry` flags can
76+ change this source. If the source contains more than one package (such as
77+ crates.io or a git repository with multiple crates) the `<crate>` argument is
78+ required to indicate which crate should be installed.
5379
5480Crates from crates.io can optionally specify the version they wish to install
5581via the `--version` flags, and similarly packages from git repositories can
@@ -62,10 +88,10 @@ By default cargo will refuse to overwrite existing binaries. The `--force` flag
6288enables overwriting existing binaries. Thus you can reinstall a crate with
6389`cargo install --force <crate>`.
6490
65- Omitting the <crate> specification entirely will
66- install the crate in the current directory. That is, `install` is equivalent to
67- the more explicit `install --path .`. This behaviour is deprecated, and no
68- longer supported as of the Rust 2018 edition.
91+ Omitting the <crate> specification entirely will install the crate in the
92+ current directory. That is, `install` is equivalent to the more explicit
93+ `install --path .`. This behaviour is deprecated, and no longer supported as
94+ of the Rust 2018 edition.
6995
7096If the source is crates.io or `--git` then by default the crate will be built
7197in a temporary target directory. To avoid this, the target directory can be
0 commit comments