MichaelAquilina / zsh-you-should-use

📎 ZSH plugin that reminds you to use existing aliases for commands you just typed
GNU General Public License v3.0
1.46k stars 43 forks source link

Only show one result for overlapping aliases #2

Closed rdnetto closed 7 years ago

rdnetto commented 7 years ago

I get the following output for git status:

$ git status
Found existing alias for "git". You should use: "g"
Found existing alias for "git status". You should use: "gs"

It would be nice if it only showed the longest matching alias, rather than all of them.

MichaelAquilina commented 7 years ago

This is something I was actaully wondering how to handle correctly.

I think it's useful to see multiple options for aliases that can be used, but I also agree that showing multiple results can be too much to display to the user.

Perhaps I can make this a configurable option.

MichaelAquilina commented 7 years ago

How about an option that provides several ways of displaying results. What you suggested could be "Best Match" and the the current could be "All"?

MichaelAquilina commented 7 years ago

@rdnetto try out the branch in PR #5 to see if this matches your use case :) The code needs to be cleaned up but works from what I have tested

rdnetto commented 7 years ago

Awesome, works great! Thanks for that :)