.help("Additional `Cargo.toml` to sync and vendor")
.value_name("TOML")
.allow_invalid_utf8(true)
- .multiple_occurrences(true)
- .multiple_values(true),
+ .multiple_occurrences(true),
)
.arg(
Arg::new("respect-source-config")
{{#options}}
{{#option "`-s` _manifest_" "`--sync` _manifest_" }}
-Specify extra `Cargo.toml` manifests to workspaces which should also be
-vendored and synced to the output.
+Specify an extra `Cargo.toml` manifest to workspaces which should also be
+vendored and synced to the output. May be specified multiple times.
{{/option}}
{{#option "`--no-delete`" }}
OPTIONS
Vendor Options
-s manifest, --sync manifest
- Specify extra Cargo.toml manifests to workspaces which should also
- be vendored and synced to the output.
+ Specify an extra Cargo.toml manifest to workspaces which should also
+ be vendored and synced to the output. May be specified multiple
+ times.
--no-delete
Don't delete the "vendor" directory when vendoring, but rather keep
<dt class="option-term" id="option-cargo-vendor--s"><a class="option-anchor" href="#option-cargo-vendor--s"></a><code>-s</code> <em>manifest</em></dt>
<dt class="option-term" id="option-cargo-vendor---sync"><a class="option-anchor" href="#option-cargo-vendor---sync"></a><code>--sync</code> <em>manifest</em></dt>
-<dd class="option-desc">Specify extra <code>Cargo.toml</code> manifests to workspaces which should also be
-vendored and synced to the output.</dd>
+<dd class="option-desc">Specify an extra <code>Cargo.toml</code> manifest to workspaces which should also be
+vendored and synced to the output. May be specified multiple times.</dd>
<dt class="option-term" id="option-cargo-vendor---no-delete"><a class="option-anchor" href="#option-cargo-vendor---no-delete"></a><code>--no-delete</code></dt>
\fB\-s\fR \fImanifest\fR,
\fB\-\-sync\fR \fImanifest\fR
.RS 4
-Specify extra \fBCargo.toml\fR manifests to workspaces which should also be
-vendored and synced to the output.
+Specify an extra \fBCargo.toml\fR manifest to workspaces which should also be
+vendored and synced to the output. May be specified multiple times.
.RE
.sp
\fB\-\-no\-delete\fR
p.cargo("build").cwd("bar").run();
}
+#[cargo_test]
+fn test_sync_argument() {
+ let p = project()
+ .no_manifest()
+ .file(
+ "foo/Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "0.1.0"
+
+ [dependencies]
+ bitflags = "=0.7.0"
+ "#,
+ )
+ .file("foo/src/lib.rs", "")
+ .file(
+ "bar/Cargo.toml",
+ r#"
+ [package]
+ name = "bar"
+ version = "0.1.0"
+
+ [dependencies]
+ bitflags = "=0.8.0"
+ "#,
+ )
+ .file("bar/src/lib.rs", "")
+ .file(
+ "baz/Cargo.toml",
+ r#"
+ [package]
+ name = "baz"
+ version = "0.1.0"
+
+ [dependencies]
+ bitflags = "=0.8.0"
+ "#,
+ )
+ .file("baz/src/lib.rs", "")
+ .build();
+
+ Package::new("bitflags", "0.7.0").publish();
+ Package::new("bitflags", "0.8.0").publish();
+
+ p.cargo("vendor --respect-source-config --manifest-path foo/Cargo.toml -s bar/Cargo.toml baz/Cargo.toml test_vendor")
+ .with_stderr("\
+error: Found argument 'test_vendor' which wasn't expected, or isn't valid in this context
+
+USAGE:
+ cargo[EXE] vendor [OPTIONS] [path]
+
+For more information try --help",
+ )
+ .with_status(1)
+ .run();
+
+ p.cargo("vendor --respect-source-config --manifest-path foo/Cargo.toml -s bar/Cargo.toml -s baz/Cargo.toml test_vendor")
+ .run();
+
+ let lock = p.read_file("test_vendor/bitflags/Cargo.toml");
+ assert!(lock.contains("version = \"0.8.0\""));
+ let lock = p.read_file("test_vendor/bitflags-0.7.0/Cargo.toml");
+ assert!(lock.contains("version = \"0.7.0\""));
+}
+
#[cargo_test]
fn delete_old_crates() {
let p = project()