]>
Commit | Line | Data |
---|---|---|
04ddd4d0 | 1 | use crate::command_prelude::*; |
54527635 | 2 | |
6b9c063b | 3 | use cargo::ops; |
1956c5d8 | 4 | use cargo::ops::FetchOptions; |
6b9c063b | 5 | |
54527635 AK |
6 | pub 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 | 15 | pub 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 | } |