Bash-it / bash-it

A community Bash framework.
MIT License
14.27k stars 2.29k forks source link

Structure all aliases (one PR per command group) #2080

Open EmilyGraceSeville7cf opened 2 years ago

EmilyGraceSeville7cf commented 2 years ago

Add new several aliases where each alias consists of first two letters of each word.

List of existing aliases

List of new aliases

gaelicWizard commented 2 years ago

Sorry, I'm generally against adding aliases that are not obviously useful to the intended audience. (Obviously they don't need to be useful to everyone!) Aliases are captured by functions, so adding unneeded aliases increases unforeseen risks in entirely unrelated code.

for example:

alias gs='git stash'

function Ghostscript-something-something() {
    # some stuff...
    gs --silent --sss=blah
}

type Ghostscript-something-something

Notice that my function definition mentions git absolutely nowhere, but notice alsö that when I ask for it's definition it absolutely does say git stash right there.


The Bash manual says to use functions instead of aliases. Aliases are evaluated at input, not at parse, which is wild and makes my brain hurt. Aliases are not just convenience shortcuts!

EmilyGraceSeville7cf commented 2 years ago

I want make alises easy to memorize. I can't find any naming rules for them now. But also I don't want make breaking change (rename aliases) because they may be in use now. That's why I add new aliases instead of renaming and note about somewhere in changelog. After a while I am going to remove old aliases.

Here is an example:

alias yaa='yarn add' # YArn Add
alias yapa='yarn pack' # YArn PAck, but not YArn Pack

How to remember which aliases use just first letter of the second word and what use two or more letters? There are many such examples. It's the same problem as short options with just different letter case. How to remember when and why use each case? ;)