diff --git a/cargo/src/cli.rs b/cargo/src/cli.rs index 96cb9c0..8e73d3f 100644 --- a/cargo/src/cli.rs +++ b/cargo/src/cli.rs @@ -58,8 +58,7 @@ pub struct Opts { #[arg( long, short = 'C', - help = "Whether you want to manually set the root of the project. Useful with a combination \ - with `--manifest-paths` or `--no-root-manifest`." + help = "Whether you want to manually set the root of the project. Useful with a combination with `--manifest-paths` or `--no-root-manifest`." )] pub custom_root: Option, #[arg( @@ -68,8 +67,7 @@ pub struct Opts { requires_if("registry", "method"), default_value_t = false, action = clap::ArgAction::Set, - help = "Available only if `--method` is set to registry. If a project has no root manifest, this flag is useful for those situations to set \ - the manifest path manually. Useful in combination with `--manifest-paths` flag.")] + help = "Available only if `--method` is set to registry. If a project has no root manifest, this flag is useful for those situations to set the manifest path manually. Useful in combination with `--manifest-paths` flag.")] pub no_root_manifest: bool, #[arg( long, @@ -83,11 +81,14 @@ pub struct Opts { help = "Tag some files for multi-vendor and multi-cargo_config projects" )] pub tag: Option, - #[arg(long, help = "Other cargo manifest files to sync with vendor", visible_aliases = ["cargotoml"])] - pub manifest_paths: Vec, - #[arg(long, default_value_t = true, action = clap::ArgAction::Set, help = "Update dependencies or not")] + #[arg(long, help = "Other cargo manifest files to sync with vendor or registry. Behaviour between methods changes. Consult the documentation.", visible_aliases = ["cargotoml"])] + pub manifest_path: Vec, + #[arg(long, default_value_t = true, action = clap::ArgAction::Set, help = "Update dependencies or not.")] pub update: bool, - #[arg(long, help = "Where to output vendor.tar* and cargo_config")] + #[arg( + long, + help = "Where to output vendor.tar* and cargo_config if method is vendor and registry.tar* if method is registry." + )] pub outdir: PathBuf, #[arg( long, diff --git a/cargo/src/registry.rs b/cargo/src/registry.rs index ec108f7..f7fca94 100644 --- a/cargo/src/registry.rs +++ b/cargo/src/registry.rs @@ -37,7 +37,7 @@ pub fn run_cargo_vendor_home_registry(setup_workdir: &Path, registry: &Opts) -> info!("💼 Fetched dependencies."); } let mut lockfiles: Vec = Vec::new(); - for manifest in ®istry.manifest_paths { + for manifest in ®istry.manifest_path { let full_manifest_path = &setup_workdir.join(manifest); let full_manifest_path_parent = full_manifest_path.parent().unwrap_or(setup_workdir); if full_manifest_path.is_file() { diff --git a/cargo/src/vendor.rs b/cargo/src/vendor.rs index 3738d12..403d004 100644 --- a/cargo/src/vendor.rs +++ b/cargo/src/vendor.rs @@ -34,7 +34,7 @@ pub fn run_cargo_vendor( custom_root, vendor_opts.vendor_specific_args.versioned_dirs, vendor_opts.vendor_specific_args.filter, - &vendor_opts.manifest_paths, + &vendor_opts.manifest_path, vendor_opts.update, &vendor_opts.i_accept_the_risk, )? { diff --git a/cargo/tests/behaviour.rs b/cargo/tests/behaviour.rs index 42c3644..a834d03 100644 --- a/cargo/tests/behaviour.rs +++ b/cargo/tests/behaviour.rs @@ -43,7 +43,7 @@ async fn vendor_source(source: &str, filter: bool) -> io::Result { src: outfile.to_path_buf(), compression: Compression::default(), tag: Some(random_tag.clone()), - manifest_paths: vec![], + manifest_path: vec![], update: true, vendor_specific_args, outdir: outdir.to_path_buf(), @@ -148,7 +148,7 @@ async fn vendor_registry_test_with_no_root_manifest() -> io::Result<()> { src: outfile.to_path_buf(), compression: Compression::default(), tag: Some(random_tag.clone()), - manifest_paths: [PathBuf::from("rust/pvsecret/Cargo.toml")].to_vec(), + manifest_path: [PathBuf::from("rust/pvsecret/Cargo.toml")].to_vec(), update: true, vendor_specific_args, outdir: outdir.to_path_buf(), @@ -224,7 +224,7 @@ async fn manifest_paths_with_vendor() -> io::Result<()> { src: outfile.to_path_buf(), compression: Compression::default(), tag: Some(random_tag.clone()), - manifest_paths: [PathBuf::from("libflux/Cargo.toml")].to_vec(), + manifest_path: [PathBuf::from("libflux/Cargo.toml")].to_vec(), update: true, outdir: outdir.to_path_buf(), color: clap::ColorChoice::Auto, @@ -293,7 +293,7 @@ async fn custom_root_test() -> io::Result<()> { src: outfile.to_path_buf(), compression: Compression::default(), tag: Some(random_tag.clone()), - manifest_paths: vec![], + manifest_path: vec![], update: true, outdir: outdir.to_path_buf(), color: clap::ColorChoice::Auto,