Skip to content

Commit fd80795

Browse files
committed
Convert --explicit-version -> --versioned-dirs
1 parent 78f45b9 commit fd80795

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

src/bin/cargo/commands/vendor.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ pub fn cli() -> App {
2828
.multiple(true),
2929
)
3030
.arg(
31-
Arg::with_name("explicit-version")
32-
.short("-x")
33-
.long("explicit-version")
31+
Arg::with_name("versioned-dirs")
32+
.long("versioned-dirs")
3433
.help("Always include version in subdir name"),
3534
)
3635
.arg(
@@ -114,7 +113,7 @@ https://github.com/rust-lang/cargo/issues/new
114113
&ops::VendorOptions {
115114
no_delete: args.is_present("no-delete"),
116115
destination: &path,
117-
explicit_version: args.is_present("explicit-version"),
116+
versioned_dirs: args.is_present("versioned-dirs"),
118117
extra: args
119118
.values_of_os("tomls")
120119
.unwrap_or_default()

src/cargo/ops/vendor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::path::{Path, PathBuf};
1414

1515
pub struct VendorOptions<'a> {
1616
pub no_delete: bool,
17-
pub explicit_version: bool,
17+
pub versioned_dirs: bool,
1818
pub destination: &'a Path,
1919
pub extra: Vec<PathBuf>,
2020
}
@@ -187,7 +187,7 @@ fn sync(
187187
.parent()
188188
.expect("manifest_path should point to a file");
189189
let max_version = *versions[&id.name()].iter().rev().next().unwrap().0;
190-
let dir_has_version_suffix = opts.explicit_version || id.version() != max_version;
190+
let dir_has_version_suffix = opts.versioned_dirs || id.version() != max_version;
191191
let dst_name = if dir_has_version_suffix {
192192
// Eg vendor/futures-0.1.13
193193
format!("{}-{}", id.name(), id.version())

src/etc/man/cargo-vendor.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ Don\(cqt delete the "vendor" directory when vendoring, but rather keep all
5757
existing contents of the vendor directory.
5858
.RE
5959
.sp
60-
\fB\-\-explicit\-version\fP
60+
\fB\-\-versioned\-dirs\fP
6161
.RS 4
6262
Normally versions are only added to disambiguate multiple versions of the same package.
63-
This option causes all directories in the "vendor" directory to be explicitly versioned,
63+
This option causes all directories in the "vendor" directory to be versioned,
6464
which makes it easier to track the history of vendored packages over time, and can help
6565
with the performance of re-vendoring when only a subset of the packages have changed.
6666
.RE

tests/testsuite/vendor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fn two_explicit_versions() {
121121
Package::new("bitflags", "0.7.0").publish();
122122
Package::new("bitflags", "0.8.0").publish();
123123

124-
p.cargo("vendor --respect-source-config --explicit-version")
124+
p.cargo("vendor --respect-source-config --versioned-dirs")
125125
.run();
126126

127127
let lock = p.read_file("vendor/bitflags-0.8.0/Cargo.toml");

0 commit comments

Comments
 (0)