Shadowing command with alias as a default configuration #8360
Labels
A-aliases
Area: command aliases
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Describe the problem you are trying to solve
I often run the same commands over and over with the same set of flags (
--all-features
,--all-targets
,--deny warnings
). Then I found out about the.cargo/config
and the[alias]
section. So I thought about doing a recursive alias (like I would do with aliases in a shell).But this is not possible as it is shadowing the existing
clippy
command. Actually, it might even be a bug because this is what I get when I'm trying to do that.Describe the solution you'd like
Like aliases in a shell, I'd expect the
alias
defined above to just work when typingcargo clippy
.One nice advantage would be that all the project's contributors would follow the same configuration for the project (including the CI).
Notes
I'm throwing the idea but I'm also aware of the weirdness in a recursive definition. It might not be desirable.
Another possible drawback: it might be harder to use the original
clippy
command. For example, in shell, if we had analias ls="ls -l"
, we could use the original command (and therefore deactivate the-l
option) by doing/usr/bin/ls
. Not sure how to reproduce a similar behavior withcargo
.Related issues
#2901
The text was updated successfully, but these errors were encountered: