-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
Problem
Users can define aliases in ~/.cargo/config
.
But user-defined b
, r
, and t
aliases do not work because they are shadowed by subcommand aliases (resp. for build
, run
, and test
).
Cargo does not emit any warnings.
Steps
- Add the following definition to
~/.cargo/config
[alias]
b = "foo"
- Run
cargo b
- Cargo executes
build
subcommand, notfoo
, without any warnings
Notes
- Current Cargo warns user-defined aliases shadowed by (non-alias) subcommands here:
Lines 121 to 126 in efb7972
(Some(_), Some(_)) => { config.shell().warn(format!( "alias `{}` is ignored, because it is shadowed by a built in command", cmd ))?; } - I sent a PR that adds
c
alias forcheck
(Addc
alias forcheck
#6218), which will shadow user-definedc
aliases. - Documenting subcommand aliases would tell people not to define such aliases (Aliases entirely undocumented #4391).
Output of cargo version
:
cargo 1.29.0 (524a578d7 2018-08-05)
Metadata
Metadata
Assignees
Labels
No labels