1CARGO-FETCH(1) CARGO-FETCH(1)
2
3
4
6 cargo-fetch - Fetch dependencies of a package from the network
7
9 cargo fetch [OPTIONS]
10
12 If a Cargo.lock file is available, this command will ensure that all of
13 the git dependencies and/or registry dependencies are downloaded and
14 locally available. Subsequent Cargo commands never touch the network
15 after a cargo fetch unless the lock file changes.
16
17 If the lock file is not available, then this command will generate the
18 lock file before fetching the dependencies.
19
20 If --target is not specified, then all target dependencies are fetched.
21
22 See also the cargo-prefetch <https://crates.io/crates/cargo-prefetch>
23 plugin which adds a command to download popular crates. This may be
24 useful if you plan to use Cargo without a network with the --offline
25 flag.
26
28 Fetch options
29 --target TRIPLE
30 Fetch for the given architecture. The default is the host
31 architecture. The general format of the triple is
32 <arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
33 a list of supported targets.
34
35 This may also be specified with the build.target config value
36 <https://doc.rust-lang.org/cargo/reference/config.html>.
37
38 Display Options
39 -v, --verbose
40 Use verbose output. May be specified twice for "very verbose"
41 output which includes extra output such as dependency warnings and
42 build script output. May also be specified with the term.verbose
43 config value
44 <https://doc.rust-lang.org/cargo/reference/config.html>.
45
46 -q, --quiet
47 No output printed to stdout.
48
49 --color WHEN
50 Control when colored output is used. Valid values:
51
52 · auto (default): Automatically detect if color support is
53 available on the terminal.
54
55 · always: Always display colors.
56
57 · never: Never display colors.
58
59 May also be specified with the term.color config value
60 <https://doc.rust-lang.org/cargo/reference/config.html>.
61
62 Manifest Options
63 --manifest-path PATH
64 Path to the Cargo.toml file. By default, Cargo searches in the
65 current directory or any parent directory for the Cargo.toml file.
66
67 --frozen, --locked
68 Either of these flags requires that the Cargo.lock file is
69 up-to-date. If the lock file is missing, or it needs to be updated,
70 Cargo will exit with an error. The --frozen flag also prevents
71 Cargo from attempting to access the network to determine if it is
72 out-of-date.
73
74 These may be used in environments where you want to assert that the
75 Cargo.lock file is up-to-date (such as a CI build) or want to avoid
76 network access.
77
78 --offline
79 Prevents Cargo from accessing the network for any reason. Without
80 this flag, Cargo will stop with an error if it needs to access the
81 network and the network is not available. With this flag, Cargo
82 will attempt to proceed without the network if possible.
83
84 Beware that this may result in different dependency resolution than
85 online mode. Cargo will restrict itself to crates that are
86 downloaded locally, even if there might be a newer version as
87 indicated in the local copy of the index. See the cargo-fetch(1)
88 command to download dependencies before going offline.
89
90 May also be specified with the net.offline config value
91 <https://doc.rust-lang.org/cargo/reference/config.html>.
92
93 Common Options
94 -h, --help
95 Prints help information.
96
97 -Z FLAG...
98 Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
99 details.
100
102 See the reference
103 <https://doc.rust-lang.org/cargo/reference/environment-variables.html>
104 for details on environment variables that Cargo reads.
105
107 0
108 Cargo succeeded.
109
110 101
111 Cargo failed to complete.
112
114 1. Fetch all dependencies:
115
116 cargo fetch
117
119 cargo(1), cargo-update(1), cargo-generate-lockfile(1)
120
121
122
123 2019-06-07 CARGO-FETCH(1)