blob: 1fb8c1c1797c4124b7e25a61bd0f587b157cea88 [file] [log] [blame]
Matthew Maurerbd398542019-09-05 16:25:08 -07001'\" 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"
31cargo\-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
37If a \fBCargo.lock\fP file is available, this command will ensure that all of the
38git dependencies and/or registry dependencies are downloaded and locally
39available. Subsequent Cargo commands never touch the network after a \fBcargo
40fetch\fP unless the lock file changes.
41.sp
42If the lock file is not available, then this command will generate the lock
43file before fetching the dependencies.
44.sp
45If \fB\-\-target\fP is not specified, then all target dependencies are fetched.
46.sp
47See also the \c
48.URL "https://crates.io/crates/cargo\-prefetch" "cargo\-prefetch"
49plugin which adds a command to download popular crates. This may be useful if
50you 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
56Fetch for the given architecture. The default is the host
57architecture. The general format of the triple is
58\fB<arch><sub>\-<vendor>\-<sys>\-<abi>\fP. Run \fBrustc \-\-print target\-list\fP for a
59list of supported targets.
60.sp
61This 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
68Use verbose output. May be specified twice for "very verbose" output which
69includes extra output such as dependency warnings and build script output.
70May 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
76No output printed to stdout.
77.RE
78.sp
79\fB\-\-color\fP \fIWHEN\fP
80.RS 4
81Control 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
92terminal.
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
117May 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
124Path to the \fBCargo.toml\fP file. By default, Cargo searches in the current
125directory or any parent directory for the \fBCargo.toml\fP file.
126.RE
127.sp
128\fB\-\-frozen\fP, \fB\-\-locked\fP
129.RS 4
130Either of these flags requires that the \fBCargo.lock\fP file is
131up\-to\-date. If the lock file is missing, or it needs to be updated, Cargo will
132exit with an error. The \fB\-\-frozen\fP flag also prevents Cargo from
133attempting to access the network to determine if it is out\-of\-date.
134.sp
135These 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
137access.
138.RE
139.sp
140\fB\-\-offline\fP
141.RS 4
142Prevents Cargo from accessing the network for any reason. Without this
143flag, Cargo will stop with an error if it needs to access the network and
144the network is not available. With this flag, Cargo will attempt to
145proceed without the network if possible.
146.sp
147Beware that this may result in different dependency resolution than online
148mode. Cargo will restrict itself to crates that are downloaded locally, even
149if there might be a newer version as indicated in the local copy of the index.
150See the \fBcargo\-fetch\fP(1) command to download dependencies before going
151offline.
152.sp
153May 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
160Prints help information.
161.RE
162.sp
163\fB\-Z\fP \fIFLAG\fP...
164.RS 4
165Unstable (nightly\-only) flags to Cargo. Run \fBcargo \-Z help\fP for
166details.
167.RE
168.SH "ENVIRONMENT"
169.sp
170See \c
171.URL "https://doc.rust\-lang.org/cargo/reference/environment\-variables.html" "the reference" " "
172for
173details on environment variables that Cargo reads.
174.SH "EXIT STATUS"
175.sp
1760
177.RS 4
178Cargo succeeded.
179.RE
180.sp
181101
182.RS 4
183Cargo 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.\}
195Fetch all dependencies:
196.sp
197.if n .RS 4
198.nf
199cargo 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)