};
let is_clapified = ::std::env::args().any(|arg| match arg.as_ref() {
- "build" | "bench" | "check" | "clean" | "doc" => true,
+ "build" | "bench" | "check" | "clean" | "doc" | "fetch" => true,
_ => false
});
// $mac!(check);
// $mac!(clean);
// $mac!(doc);
- $mac!(fetch);
+// $mac!(fetch);
$mac!(generate_lockfile);
$mac!(git_checkout);
$mac!(help);
--- /dev/null
+use super::utils::*;
+
+pub fn cli() -> App {
+ subcommand("fetch")
+ .about("Fetch dependencies of a package from the network")
+ .arg(
+ opt("open", "Opens the docs in a browser after the operation")
+ )
+ .arg_manifest_path()
+ .arg_locked()
+ .after_help("\
+If a lockfile is available, this command will ensure that all of the git
+dependencies and/or registries dependencies are downloaded and locally
+available. The network is never touched after a `cargo fetch` unless
+the lockfile changes.
+
+If the lockfile is not available, then this is the equivalent of
+`cargo generate-lockfile`. A lockfile is generated and dependencies are also
+all updated.
+")
+}
ops::doc(&ws, &doc_opts)?;
return Ok(());
}
+ ("fetch", Some(args)) => {
+ config_from_args(config, args)?;
+ let ws = workspace_from_args(config, args)?;
+ ops::fetch(&ws)?;
+ return Ok(());
+ }
_ => return Ok(())
}
}
check::cli(),
clean::cli(),
doc::cli(),
+ fetch::cli(),
])
;
app
mod check;
mod clean;
mod doc;
+mod fetch;
mod utils {
use clap::{self, SubCommand, AppSettings};