alias-tips icon indicating copy to clipboard operation
alias-tips copied to clipboard

Prefer the shortest command when there are multiple possible aliases

Open apaatsio opened this issue 3 years ago • 3 comments

Let's define two "overlapping" aliases (I'm using these via https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git)

alias g='git'
alias gsta='git stash save'

Current behavior

$ git stash save                                                                                                          
Alias tip: g stash save

Preferred behavior

$ git stash save                                                                                                          
Alias tip: gsta

gsta is 4 characters and g stash save is 12 characters, so gsta should be preferred.

apaatsio avatar May 27 '22 12:05 apaatsio

@djui, are you open to a PR for this? Tempted to work on it when I have time. Er, unless @apaatsio is hoping to do so, I don't want to deprive anyone of fun times.

mrienstra avatar Nov 03 '22 17:11 mrienstra

@mrienstra Please, go ahead and have fun.

apaatsio avatar Nov 03 '22 17:11 apaatsio

@mrienstra Yes ofc! 🙏

djui avatar Nov 03 '22 17:11 djui