-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn if built-in subcommand aliases shadow user-defined aliases #6222
Conversation
r? @matklad (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
If the goal is to be able to add a new alias ( |
Umm..., sorry for confusing. BTW, the AppVeyor failure seems to be spurious (timed out). |
r? @ehuss |
I agree with @ehuss, this should be the other way round.
@ordovicia sorry for the delay. I think it would be best if user aliases took precedence over built-in ones. That would allow us to safely add aliases without disrupting existing user configurations. I think this would require not using clap aliases and instead checking them manually near where user aliases are checked. |
Thank you all. I am convinced. |
This PR makes Cargo emit a warning if built-in subcommand aliases (
b
,r
, andt
) shadow user-defined aliases.In order to handle subcommand aliases after clap parses the command line options, it seems to be necessary to stop using clap for subcommand aliases.
So now
help
command does not work with subcommand aliases, but I think it is not a big problem.Fixes #6221