-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
buildsubcommand, 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
calias forcheck(Addcalias forcheck#6218), which will shadow user-definedcaliases. - 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