mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
improve error message for when subcommand contains +toolchain
This commit is contained in:
parent
10e9d20d23
commit
9665334c64
@ -168,8 +168,9 @@ fn execute_external_subcommand(config: &Config, cmd: &str, args: &[&str]) -> Cli
|
|||||||
None => {
|
None => {
|
||||||
let suggestions = list_commands(config);
|
let suggestions = list_commands(config);
|
||||||
let did_you_mean = closest_msg(cmd, suggestions.keys(), |c| c);
|
let did_you_mean = closest_msg(cmd, suggestions.keys(), |c| c);
|
||||||
|
|
||||||
let err = if cmd.contains('+') {
|
let err = if cmd.contains('+') {
|
||||||
anyhow::format_err!("no such subcommand: `{}`{}\n\n\tCargo does not handle `+toolchain` directives.\n\tsuggestion: view a list of all installed Cargo subcommands using `cargo --list`", cmd, did_you_mean)
|
anyhow::format_err!("no such subcommand: `{}`{}\n\n\tCargo does not handle `+toolchain` directives itself.\n\tDid you mean to run `cargo` through `rustup` instead?\n\tsuggestion: view a list of all installed Cargo subcommands using `cargo --list`", cmd, did_you_mean)
|
||||||
} else {
|
} else {
|
||||||
anyhow::format_err!("no such subcommand: `{}`{}\n\n\tsuggestion: view a list of all installed Cargo subcommands using `cargo --list`", cmd, did_you_mean)
|
anyhow::format_err!("no such subcommand: `{}`{}\n\n\tsuggestion: view a list of all installed Cargo subcommands using `cargo --list`", cmd, did_you_mean)
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user