blob: f60ed61b854dd76aeb98f16f87b7c4f76260457d [file] [log] [blame]
use crate::command_prelude::*;
use cargo::ops;
use cargo::ops::FetchOptions;
pub fn cli() -> Command {
subcommand("fetch")
.about("Fetch dependencies of a package from the network")
.arg_silent_suggestion()
.arg_target_triple("Fetch dependencies for the target triple")
.arg_manifest_path()
.after_help(color_print::cstr!(
"Run `<cyan,bold>cargo help fetch</>` for more detailed information.\n"
))
}
pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
let ws = args.workspace(gctx)?;
let opts = FetchOptions {
gctx,
targets: args.targets()?,
};
let _ = ops::fetch(&ws, &opts)?;
Ok(())
}