-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add cargo help --commands
#12114
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
Comments
This is listed as a problem but I feel this is more of a solution. Could you elaborate why this would be useful? In thinking on this, another way to organize commands is by their role like at https://doc.rust-lang.org/cargo/commands/index.html
There are three tiers of aliases we need to keep in mind
Dealing with these makes me hesistant |
I think there are only two tiers – built-in and user-defined. We don't need special treatment for user short-hand aliases. |
I personally think the current version of
does this mean you would suggest splitting the built-in commands into their separate categories? if so... I believe this would help make |
The Cargo team discussed this in the triage meeting this week. We generally agree that the enhancement looks quite nice. However, we have some concerns and haven't yet made a decision. May need more info to move forward.
Sorry we didn't have enough time to make a decision. I am just jotting down what I can remember from the meeting. |
First of all thanks for that information.
i hope my quick thoughts can help a bit. |
|
I'll try fixing the formatting issues, as seems like it's accepted that having a big list of commands isn't very readable. |
Maybe adding a We could use JSON as a machine readable, same as
(obviously minified) (Note that both On the topic of adding a new command, I don't know if it's a good idea. Experienced users will continue using |
Curious on the current status of this issue, I have a local copy of Cargo built from source with a fix that I'm trying too use but it doesn't want too play nice If anyone knows how I can make cargo play happily with rustup I'll just keep using my local fork until this gets more attention. |
While we implement our own |
Problem
currently, the only real way to know which cargo subcommands are available is through
cargo --list
. However the output ofcargo --list
is not very clear.the main problems for me are:
a bit more information about these problems can be found in #12093
Proposed Solution
Adding an alternative/replacement for
cargo --list
.cargo help --commands
this change would also make it clear what the comment does. Printing information about all possible commands.this could then fix the before-noted problems.
example output:
Spliting types
instead of having all commands in one long list, it would split them into 3 categories.
build-man
cargo install
but also pre-installed things likeclippy
andfmt
an example of a similar splitting behavior can be seen with
git --help
aliases
instead of having aliases and their base explanation in separate lines.
like now :
it could look more like
cargo --help
| defaultclap
helpOther formats
instead of just the normal human readable code, it would also have support for the
--message-format
flag. This would enable printing the information in a more computer-friendly way likejson
.Notes
In the future, this could be expanded to extra commands for every single command category.
in addition, all of these commands would work with
--message-format
thanks for all support / comments on #12093 by weihanglo, ehuss, epage
The text was updated successfully, but these errors were encountered: