Skip to content

Commit 78e64de

Browse files
committed
Added comments indicating which parts should be removed at appropriate time
1 parent fba459d commit 78e64de

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/bin/publish.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use cargo::util::important_paths::find_root_manifest_for_wd;
66
#[derive(Deserialize)]
77
pub struct Options {
88
flag_index: Option<String>,
9-
flag_host: Option<String>,
9+
flag_host: Option<String>, // TODO: Deprecated, remove
1010
flag_token: Option<String>,
1111
flag_manifest_path: Option<String>,
1212
flag_verbose: u32,
@@ -28,8 +28,8 @@ Usage:
2828
2929
Options:
3030
-h, --help Print this message
31-
--index INDEX Host to upload the package to
32-
--host HOST DEPRECATED
31+
--index INDEX Registry index to upload the package to
32+
--host HOST DEPRECATED, renamed to '--index'
3333
--token TOKEN Token to use when uploading
3434
--no-verify Don't verify package tarball before publish
3535
--allow-dirty Allow publishing with a dirty source directory
@@ -56,7 +56,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult {
5656
let Options {
5757
flag_token: token,
5858
flag_index: index,
59-
flag_host: host,
59+
flag_host: host, // TODO: Deprecated, remove
6060
flag_manifest_path,
6161
flag_no_verify: no_verify,
6262
flag_allow_dirty: allow_dirty,
@@ -66,6 +66,11 @@ pub fn execute(options: Options, config: &Config) -> CliResult {
6666
} = options;
6767

6868

69+
// TODO: Deprecated
70+
// remove once it has been decided --host can be removed
71+
// We may instead want to repurpose the host flag, as
72+
// mentioned in this issue
73+
// https://github.com/rust-lang/cargo/issues/4208
6974
let msg = "The flag '--host' is no longer valid.
7075
7176
Previous versions of Cargo accepted this flag, but it is being
@@ -84,7 +89,7 @@ about this warning.";
8489
token: token,
8590
index:
8691
if host.clone().is_none() || host.clone().unwrap().is_empty() { index }
87-
else { config.shell().warn(&msg)?; host },
92+
else { config.shell().warn(&msg)?; host }, // TODO: Deprecated, remove
8893
verify: !no_verify,
8994
allow_dirty: allow_dirty,
9095
jobs: jobs,

tests/publish.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ See [..]
9494
}
9595
}
9696

97+
// TODO: Deprecated
98+
// remove once it has been decided --host can be removed
9799
#[test]
98100
fn simple_with_host() {
99101
setup();
@@ -158,6 +160,8 @@ See [..]
158160
}
159161
}
160162

163+
// TODO: Deprecated
164+
// remove once it has been decided --host can be removed
161165
#[test]
162166
fn simple_with_index_and_host() {
163167
setup();

0 commit comments

Comments
 (0)