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

updated yank error message #8697

Merged
merged 2 commits into from
Sep 15, 2020
Merged

updated yank error message #8697

merged 2 commits into from
Sep 15, 2020

Conversation

mikastiv
Copy link
Contributor

@mikastiv mikastiv commented Sep 10, 2020

Fixes #8695

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Eh2406 (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 10, 2020
@Eh2406
Copy link
Contributor

Eh2406 commented Sep 10, 2020

I think there will probably need to be tests updated. If not then we will need to figure out how to add a test.

@ehuss What do you think of the new text?

@ehuss
Copy link
Contributor

ehuss commented Sep 12, 2020

Perhaps .required(true) can just be added to the --vers flag and let clap handle it. That would make the help text better (it explicitly shows --vers is required), and the error would look like this:

error: The following required arguments were not provided:
    --vers <VERSION>

USAGE:
    cargo yank [OPTIONS] --vers <VERSION> [--] [crate]

For more information try --help

@mikastiv
Copy link
Contributor Author

mikastiv commented Sep 12, 2020

This works better and is a good idea, but now the test alt_registry::bad_registry_name fails because it expects the --vers argument. Should I remove yank cmd from this test? Or maybe I put the required at the wrong place

@mikastiv
Copy link
Contributor Author

It works using .required_unless("registry"). Would this be a good option?

@ehuss
Copy link
Contributor

ehuss commented Sep 12, 2020

You can just put in a bogus version to fix that test, like this:

diff --git a/tests/testsuite/alt_registry.rs b/tests/testsuite/alt_registry.rs
index f9129e284..c3ed37633 100644
--- a/tests/testsuite/alt_registry.rs
+++ b/tests/testsuite/alt_registry.rs
@@ -637,7 +637,7 @@ Caused by:
         "owner",
         "publish",
         "search",
-        "yank",
+        "yank --vers 1.2.3",
     ] {
         p.cargo(cmd)
             .arg("--registry")

@mikastiv
Copy link
Contributor Author

Alright I did it.

@ehuss
Copy link
Contributor

ehuss commented Sep 15, 2020

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Sep 15, 2020

📌 Commit 51fa3a4 has been approved by ehuss

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 15, 2020
@bors
Copy link
Contributor

bors commented Sep 15, 2020

⌛ Testing commit 51fa3a4 with merge 8777a6b...

@bors
Copy link
Contributor

bors commented Sep 15, 2020

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing 8777a6b to master...

@bors bors merged commit 8777a6b into rust-lang:master Sep 15, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 15, 2020
Update cargo

6 commits in 875e0123259b0b6299903fe4aea0a12ecde9324f..8777a6b1e8834899f51b7e09cc9b8d85b2417110
2020-09-08 20:17:21 +0000 to 2020-09-15 19:11:03 +0000
- updated yank error message (rust-lang/cargo#8697)
- Fix non-determinism with new feature resolver. (rust-lang/cargo#8701)
- Display formatted output for JSON diffing in tests. (rust-lang/cargo#8692)
- Add --name suggestion for cargo new (rust-lang/cargo#8675)
- Sweep unrelated message from unnecessary workspace infromation (rust-lang/cargo#8681)
- Docs: Make it more clear we have two types of workspaces (rust-lang/cargo#8666)
@mikastiv mikastiv deleted the pr-8695 branch September 22, 2020 22:26
@ehuss ehuss added this to the 1.48.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cargo yank's error message should be clearer
5 participants