DannyBen / alf

Bash Alias Generator and Manager
MIT License
88 stars 5 forks source link

Can we somehow show the aliases? #57

Open madorian opened 5 days ago

madorian commented 5 days ago

I know that I can look in the alf configuration, but is there any way to list the possibilities on the command line?

DannyBen commented 5 days ago

There is alf edit and alf which CODE [SUBCODE].

Showing just the aliases could be very cryptic without knowing what they do + they have subcodes.

I am open to adding alf show or something similar, but I am not convinced it will be useful, especially not if you have a large alf.conf file like me.

Can you show a sample output you expect?

madorian commented 4 days ago

Just showing the aliases would be helpful, instead of opening the configuration file, which can be very big, for example for s:

s show
q: ssh quasar
s: ssh spartacus
DannyBen commented 4 days ago

I don't understand the output you provided. It seems like you want to see the command of the alias "s" but you also show the output for the alias "q".

If you want to see the command of a single alias, use alf which or alf w. Provide it with a code, and an optional subcode.

$ alf which g
git

$ alf w g s
git status

Applying a "show" command to any alias (i.e. g show) cannot happen, simply for the reason that supplied arguments are passed on to the function, so you can do things like this:

$ alf which g c
git add . --all && git commit -am

$ g c "Commit message"