]> git.proxmox.com Git - cargo.git/blame - src/bin/cargo/commands/fetch.rs
Auto merge of #9186 - weihanglo:issue-9054, r=alexcrichton
[cargo.git] / src / bin / cargo / commands / fetch.rs
CommitLineData
04ddd4d0 1use crate::command_prelude::*;
54527635 2
6b9c063b 3use cargo::ops;
1956c5d8 4use cargo::ops::FetchOptions;
6b9c063b 5
54527635
AK
6pub fn cli() -> App {
7 subcommand("fetch")
8 .about("Fetch dependencies of a package from the network")
e873e4e9 9 .arg(opt("quiet", "No output printed to stdout").short("q"))
54527635 10 .arg_manifest_path()
1956c5d8 11 .arg_target_triple("Fetch dependencies for the target triple")
0e26eae5 12 .after_help("Run `cargo help fetch` for more detailed information.\n")
54527635 13}
6b9c063b 14
6d1d3a68 15pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
6b9c063b 16 let ws = args.workspace(config)?;
1956c5d8
BW
17
18 let opts = FetchOptions {
19 config,
3fd28143 20 targets: args.targets(),
1956c5d8 21 };
829fd711 22 let _ = ops::fetch(&ws, &opts)?;
6b9c063b
AK
23 Ok(())
24}