.arg_target_dir()
.arg_manifest_path()
.arg_jobs()
- .arg(opt("dry-run", "Perform all checks without uploading"))
+ .arg_dry_run("Perform all checks without uploading")
.arg(opt("registry", "Registry to publish to").value_name("REGISTRY"))
}
"aggressive",
"Force updating all dependencies of <name> as well",
))
+ .arg_dry_run("Don't actually write the lockfile")
.arg(opt("precise", "Update a single dependency to exactly PRECISE").value_name("PRECISE"))
.arg_manifest_path()
.after_help(
aggressive: args.is_present("aggressive"),
precise: args.value_of("precise"),
to_update: values(args, "package"),
+ dry_run: args.is_present("dry-run"),
config,
};
ops::update_lockfile(&ws, &update_opts)?;
pub to_update: Vec<String>,
pub precise: Option<&'a str>,
pub aggressive: bool,
+ pub dry_run: bool,
}
pub fn generate_lockfile(ws: &Workspace) -> CargoResult<()> {
}
}
}
-
- ops::write_pkg_lockfile(ws, &resolve)?;
+ if opts.dry_run {
+ opts.config
+ .shell()
+ .warn("not updating lockfile due to dry run")?;
+ } else {
+ ops::write_pkg_lockfile(ws, &resolve)?;
+ }
return Ok(());
fn fill_with_deps<'a>(
.hidden(true),
)
}
+
+ fn arg_dry_run(self, dry_run: &'static str) -> Self {
+ self._arg(opt("dry-run", dry_run))
+ }
}
impl AppExt for App {