Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can "--host" related command information be deleted? #10121

Closed
heisen-li opened this issue Nov 26, 2021 · 3 comments · Fixed by #10145
Closed

Can "--host" related command information be deleted? #10121

heisen-li opened this issue Nov 26, 2021 · 3 comments · Fixed by #10145

Comments

@heisen-li
Copy link
Contributor

I found that in 2017 "--host" has been replaced by "--index". #4209

Is it necessary to keep this command or prompt message now?

// TODO: Deprecated
// remove once it has been decided '--host' can be safely removed
#[cargo_test]
fn simple_with_host() {
setup();
cargo_process("search postgres --host")
.arg(registry_url().to_string())
.with_stderr(
"\
[WARNING] The flag '--host' is no longer valid.
Previous versions of Cargo accepted this flag, but it is being
deprecated. The flag is being renamed to 'index', as the flag
wants the location of the index. Please use '--index' instead.
This will soon become a hard error, so it's either recommended
to update to a fixed version or contact the upstream maintainer
about this warning.
[UPDATING] `[CWD]/registry` index
",
)
.with_stdout_contains(SEARCH_RESULTS)
.run();
}
// TODO: Deprecated
// remove once it has been decided '--host' can be safely removed
#[cargo_test]
fn simple_with_index_and_host() {
setup();
cargo_process("search postgres --index")
.arg(registry_url().to_string())
.arg("--host")
.arg(registry_url().to_string())
.with_stderr(
"\
[WARNING] The flag '--host' is no longer valid.
Previous versions of Cargo accepted this flag, but it is being
deprecated. The flag is being renamed to 'index', as the flag
wants the location of the index. Please use '--index' instead.
This will soon become a hard error, so it's either recommended
to update to a fixed version or contact the upstream maintainer
about this warning.
[UPDATING] `[CWD]/registry` index
",
)
.with_stdout_contains(SEARCH_RESULTS)
.run();
}

and
https://github.com/rust-lang/cargo/blob/7f08ace4f1/src/cargo/util/command_prelude.rs#L633

@alexcrichton
Copy link
Member

Our policy on removing features is to first confirm that they have been warning for a long time, and only if the warning has been issued then it's safe to remove at this point.

@heisen-li
Copy link
Contributor Author

I think it has been reminded long enough. Do you mean that there is still a need to issue a warning to remove the feature? What to do next?

@alexcrichton
Copy link
Member

If the warning has been issued for years then it should be safe to remove, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants