summaryrefslogtreecommitdiffstats
path: root/src/bin/cargo/commands/fetch.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/cargo/commands/fetch.rs')
-rw-r--r--src/bin/cargo/commands/fetch.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/bin/cargo/commands/fetch.rs b/src/bin/cargo/commands/fetch.rs
new file mode 100644
index 0000000..2fbbc47
--- /dev/null
+++ b/src/bin/cargo/commands/fetch.rs
@@ -0,0 +1,24 @@
+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_quiet()
+ .arg_manifest_path()
+ .arg_target_triple("Fetch dependencies for the target triple")
+ .after_help("Run `cargo help fetch` for more detailed information.\n")
+}
+
+pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
+ let ws = args.workspace(config)?;
+
+ let opts = FetchOptions {
+ config,
+ targets: args.targets(),
+ };
+ let _ = ops::fetch(&ws, &opts)?;
+ Ok(())
+}