Description
Problem
If there is a syntax error in a .cargo/config
file, and the user tries to run an alias command, there is no indication of why it failed to find the alias.
Steps
-
Create a
.cargo/config
:[alias] foo = ["a" "b"]
Notice the missing comma.
-
Run
cargo foo
-
Observe the output:
error: no such subcommand: `foo` Did you mean `doc`?
At this point, it isn't immediately clear what went wrong.
Possible Solution(s)
If there is an error loading the config, and cargo is unable to find the command to run, then it should probably relay the config error to the user.
There may be other situations where it might be useful to relay the config error. For example, if I have an alias like clippy
, and the config fails to load, cargo will go ahead and run clippy
without the aliased arguments.
I'm not sure when and how it would be best to relay the information about the malformed config. It also may be difficult to plumb the error up to the alias-handling code.
Notes
No response
Version
cargo 1.65.0-nightly (9809f8ff3 2022-08-16)