Matthew Maurer | bd39854 | 2019-09-05 16:25:08 -0700 | [diff] [blame] | 1 | '\" t |
| 2 | .\" Title: cargo-fetch |
| 3 | .\" Author: [see the "AUTHOR(S)" section] |
| 4 | .\" Generator: Asciidoctor 1.5.8 |
| 5 | .\" Date: 2019-05-12 |
| 6 | .\" Manual: \ \& |
| 7 | .\" Source: \ \& |
| 8 | .\" Language: English |
| 9 | .\" |
| 10 | .TH "CARGO\-FETCH" "1" "2019-05-12" "\ \&" "\ \&" |
| 11 | .ie \n(.g .ds Aq \(aq |
| 12 | .el .ds Aq ' |
| 13 | .ss \n[.ss] 0 |
| 14 | .nh |
| 15 | .ad l |
| 16 | .de URL |
| 17 | \fI\\$2\fP <\\$1>\\$3 |
| 18 | .. |
| 19 | .als MTO URL |
| 20 | .if \n[.g] \{\ |
| 21 | . mso www.tmac |
| 22 | . am URL |
| 23 | . ad l |
| 24 | . . |
| 25 | . am MTO |
| 26 | . ad l |
| 27 | . . |
| 28 | . LINKSTYLE blue R < > |
| 29 | .\} |
| 30 | .SH "NAME" |
| 31 | cargo\-fetch \- Fetch dependencies of a package from the network |
| 32 | .SH "SYNOPSIS" |
| 33 | .sp |
| 34 | \fBcargo fetch [\fIOPTIONS\fP]\fP |
| 35 | .SH "DESCRIPTION" |
| 36 | .sp |
| 37 | If a \fBCargo.lock\fP file is available, this command will ensure that all of the |
| 38 | git dependencies and/or registry dependencies are downloaded and locally |
| 39 | available. Subsequent Cargo commands never touch the network after a \fBcargo |
| 40 | fetch\fP unless the lock file changes. |
| 41 | .sp |
| 42 | If the lock file is not available, then this command will generate the lock |
| 43 | file before fetching the dependencies. |
| 44 | .sp |
| 45 | If \fB\-\-target\fP is not specified, then all target dependencies are fetched. |
| 46 | .sp |
| 47 | See also the \c |
| 48 | .URL "https://crates.io/crates/cargo\-prefetch" "cargo\-prefetch" |
| 49 | plugin which adds a command to download popular crates. This may be useful if |
| 50 | you plan to use Cargo without a network with the \fB\-\-offline\fP flag. |
| 51 | .SH "OPTIONS" |
| 52 | .SS "Fetch options" |
| 53 | .sp |
| 54 | \fB\-\-target\fP \fITRIPLE\fP |
| 55 | .RS 4 |
| 56 | Fetch for the given architecture. The default is the host |
| 57 | architecture. The general format of the triple is |
| 58 | \fB<arch><sub>\-<vendor>\-<sys>\-<abi>\fP. Run \fBrustc \-\-print target\-list\fP for a |
| 59 | list of supported targets. |
| 60 | .sp |
| 61 | This may also be specified with the \fBbuild.target\fP |
| 62 | .URL "https://doc.rust\-lang.org/cargo/reference/config.html" "config value" "." |
| 63 | .RE |
| 64 | .SS "Display Options" |
| 65 | .sp |
| 66 | \fB\-v\fP, \fB\-\-verbose\fP |
| 67 | .RS 4 |
| 68 | Use verbose output. May be specified twice for "very verbose" output which |
| 69 | includes extra output such as dependency warnings and build script output. |
| 70 | May also be specified with the \fBterm.verbose\fP |
| 71 | .URL "https://doc.rust\-lang.org/cargo/reference/config.html" "config value" "." |
| 72 | .RE |
| 73 | .sp |
| 74 | \fB\-q\fP, \fB\-\-quiet\fP |
| 75 | .RS 4 |
| 76 | No output printed to stdout. |
| 77 | .RE |
| 78 | .sp |
| 79 | \fB\-\-color\fP \fIWHEN\fP |
| 80 | .RS 4 |
| 81 | Control when colored output is used. Valid values: |
| 82 | .sp |
| 83 | .RS 4 |
| 84 | .ie n \{\ |
| 85 | \h'-04'\(bu\h'+03'\c |
| 86 | .\} |
| 87 | .el \{\ |
| 88 | . sp -1 |
| 89 | . IP \(bu 2.3 |
| 90 | .\} |
| 91 | \fBauto\fP (default): Automatically detect if color support is available on the |
| 92 | terminal. |
| 93 | .RE |
| 94 | .sp |
| 95 | .RS 4 |
| 96 | .ie n \{\ |
| 97 | \h'-04'\(bu\h'+03'\c |
| 98 | .\} |
| 99 | .el \{\ |
| 100 | . sp -1 |
| 101 | . IP \(bu 2.3 |
| 102 | .\} |
| 103 | \fBalways\fP: Always display colors. |
| 104 | .RE |
| 105 | .sp |
| 106 | .RS 4 |
| 107 | .ie n \{\ |
| 108 | \h'-04'\(bu\h'+03'\c |
| 109 | .\} |
| 110 | .el \{\ |
| 111 | . sp -1 |
| 112 | . IP \(bu 2.3 |
| 113 | .\} |
| 114 | \fBnever\fP: Never display colors. |
| 115 | .RE |
| 116 | .sp |
| 117 | May also be specified with the \fBterm.color\fP |
| 118 | .URL "https://doc.rust\-lang.org/cargo/reference/config.html" "config value" "." |
| 119 | .RE |
| 120 | .SS "Manifest Options" |
| 121 | .sp |
| 122 | \fB\-\-manifest\-path\fP \fIPATH\fP |
| 123 | .RS 4 |
| 124 | Path to the \fBCargo.toml\fP file. By default, Cargo searches in the current |
| 125 | directory or any parent directory for the \fBCargo.toml\fP file. |
| 126 | .RE |
| 127 | .sp |
| 128 | \fB\-\-frozen\fP, \fB\-\-locked\fP |
| 129 | .RS 4 |
| 130 | Either of these flags requires that the \fBCargo.lock\fP file is |
| 131 | up\-to\-date. If the lock file is missing, or it needs to be updated, Cargo will |
| 132 | exit with an error. The \fB\-\-frozen\fP flag also prevents Cargo from |
| 133 | attempting to access the network to determine if it is out\-of\-date. |
| 134 | .sp |
| 135 | These may be used in environments where you want to assert that the |
| 136 | \fBCargo.lock\fP file is up\-to\-date (such as a CI build) or want to avoid network |
| 137 | access. |
| 138 | .RE |
| 139 | .sp |
| 140 | \fB\-\-offline\fP |
| 141 | .RS 4 |
| 142 | Prevents Cargo from accessing the network for any reason. Without this |
| 143 | flag, Cargo will stop with an error if it needs to access the network and |
| 144 | the network is not available. With this flag, Cargo will attempt to |
| 145 | proceed without the network if possible. |
| 146 | .sp |
| 147 | Beware that this may result in different dependency resolution than online |
| 148 | mode. Cargo will restrict itself to crates that are downloaded locally, even |
| 149 | if there might be a newer version as indicated in the local copy of the index. |
| 150 | See the \fBcargo\-fetch\fP(1) command to download dependencies before going |
| 151 | offline. |
| 152 | .sp |
| 153 | May also be specified with the \fBnet.offline\fP \c |
| 154 | .URL "https://doc.rust\-lang.org/cargo/reference/config.html" "config value" "." |
| 155 | .RE |
| 156 | .SS "Common Options" |
| 157 | .sp |
| 158 | \fB\-h\fP, \fB\-\-help\fP |
| 159 | .RS 4 |
| 160 | Prints help information. |
| 161 | .RE |
| 162 | .sp |
| 163 | \fB\-Z\fP \fIFLAG\fP... |
| 164 | .RS 4 |
| 165 | Unstable (nightly\-only) flags to Cargo. Run \fBcargo \-Z help\fP for |
| 166 | details. |
| 167 | .RE |
| 168 | .SH "ENVIRONMENT" |
| 169 | .sp |
| 170 | See \c |
| 171 | .URL "https://doc.rust\-lang.org/cargo/reference/environment\-variables.html" "the reference" " " |
| 172 | for |
| 173 | details on environment variables that Cargo reads. |
| 174 | .SH "EXIT STATUS" |
| 175 | .sp |
| 176 | 0 |
| 177 | .RS 4 |
| 178 | Cargo succeeded. |
| 179 | .RE |
| 180 | .sp |
| 181 | 101 |
| 182 | .RS 4 |
| 183 | Cargo failed to complete. |
| 184 | .RE |
| 185 | .SH "EXAMPLES" |
| 186 | .sp |
| 187 | .RS 4 |
| 188 | .ie n \{\ |
| 189 | \h'-04' 1.\h'+01'\c |
| 190 | .\} |
| 191 | .el \{\ |
| 192 | . sp -1 |
| 193 | . IP " 1." 4.2 |
| 194 | .\} |
| 195 | Fetch all dependencies: |
| 196 | .sp |
| 197 | .if n .RS 4 |
| 198 | .nf |
| 199 | cargo fetch |
| 200 | .fi |
| 201 | .if n .RE |
| 202 | .RE |
| 203 | .SH "SEE ALSO" |
| 204 | .sp |
| 205 | \fBcargo\fP(1), \fBcargo\-update\fP(1), \fBcargo\-generate\-lockfile\fP(1) |