Skip to content

cargo help <alias> should show what <alias> stands for #10138

Closed

Description

@poliorcetics

Problem

Currently, if I have a .cargo/config like this:

[alias]
bw = "build --target x86_64-pc-windows-msvc --release"
bl = "build --target x86_64-unknown-linux-musl --release"

And I do cargo help bw

I get the help for cargo build

Proposed Solution

Instead of the current behavior, I would like something like git:

$ git help c
'c' is aliased to 'commit'

$ git help cam
'cam' is aliased to 'commit --amend -m'

If I want the infos for build, cargo bw --help would still work, just like git cam --help show the full help for commit in the example above.

Notes

One thing I have not seen git do is tell from where the alias comes. If possible, indicating the file (and even the precise location) would be very nice.

The same could be done for subcommands like cargo add from cargo-edit, with something like this:

$ cargo help add
`cargo add` comes from `$CARGo_HOME/bin/cargo-add`

But this could be a separate feature request, I don't know how much the two are linked internally.

Activity

  1. added
    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
    on Nov 30, 2021
  2. added a commit that references this issue on Dec 11, 2021
    7084570
  3. added a commit that references this issue on Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-aliasesArea: command aliasesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions