-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Make cargo --list
combine commands and their aliases
#12093
Comments
As you can see, Cargo provides the ability to define custom aliases.
If we put the alias side by side on the same line of the original command name, it might be a bit confusing seeing other custom aliases shows on their own lines. I would suggest the followings
Some pointers:
|
|
what do you think about also spitting commands installed through then there would be 'Built-In commands', 'User-defined aliases', and 'Installed commands' |
Sounds good to me! |
I would like to try implementing this my self. is there anything else I should do first / pay attention to? |
You can use Feel free to hack it. If you have any question, ask here, open a topic on T-cargo, or ping me on Zulip. |
@rustbot claim |
Just beware that there are tools which parse the output of I think we need to be careful with making too extreme of changes. Some suggestions:
|
I just recall that built-in aliases are able to get overridden by custom aliases. It will be a bit weird to put cargo/tests/testsuite/cargo_alias_config.rs Lines 362 to 385 in e2d1488
Given it needs more inputs than I thought, I'll label as E-medium to reflect the effort level. |
ok, I just finished creating a basic working version. which does not handle the consistency issue called out by ehuss or the overwriting behavior. should I make a draft so somebody can have a look at it? how should we handle the consistency issue? maby making the new |
A draft PR seems good to me, though I would highly recommend looking into ehuss's suggestions first. Looks like fish is immune from adding new sections. However bash and zsh are not. I wonder if we can make bash and zsh do a similar filter-and-replace way. Then we ship it first. Wait it until hitting stable, and then release our We should also check some major shell framework (ohmyzsh, bash-completions, etc) if they vendor our shell completions, and inform them about the change upfront, or just submit patches to them.
Personally, I'd like to see |
what would you think about not doing any changes to the current we should then make it clear that this should enable the cleanest migration... I think. |
That would be really plausible! I believe it is highly possible to accept the proposal as an unstable feature. You can follow the instruction here and code-level guide here to make new unstable flags. I bet In order to continue the discussion before hacking, I would recommend making a tiny semiformal design proposal (not RFC), similar to #11099. It should list what is going to be added and what is the expected behaivour. Prior arts from other CLI tools, etc. It doesn't need to be that long but informative. |
should I open a new issue for this proposal because the scope slightly changed? did I understand correctly that this proposal should explain which commands/flags would be added and how there would work? it is not supposed to explain how the code itself should look. would be ok to change some of the current
|
Some quick thoughts
To add to ehuss' comments, my suggestion would be to prioritize what you want to see changed and do it incrementally (at least one change per PR) so we can evaluate each one and decide whether to keep it or not or so we can easily revert the parts of it later. It'd also be good for us to have #11912 merged first but its stuck in limbo |
If it is a completely different stuff. I'd suggest open a new one and maybe close this if it is not needed anymore.
Yes. We can discuss starting at high level but you may want to take epage's advice: Do it incrementally. The proposal needn't be a gigantic one.
If you find any refactor making sense, helping the code more structured and easy to reason, feel free to do so! |
Problem
Currently
cargo --list
splits the command itself and its aliase in seperate linesProposed Solution
i would say this should be changed to a simular / the same system as
clap
has.combining the command and its aliase
this behavior can already be seen in
cargo --help
Notes
No response
The text was updated successfully, but these errors were encountered: