On Tue, Jan 7, 2025, at 9:42 PM, Xavier Maillard wrote:
> I already have read that. My question was really this one: is it fine 
> to use ‘function’ as a mean to define what could have been a simple 
> abbreviation.
>
> For example:
>
> function wget --description 'alias wget=wget 
> --hsts-file="$XDG_DATA_HOME/wget-hsts"'
>     command wget --hsts-file="$XDG_DATA_HOME/wget-hsts" $argv
> end
>
> Or
>
> abbr -a wget 'wget --hsts-file="$XDG_DATA_HOME/wget-hsts"’ 
>
> Which one is okay/preferred ?

I think that they are both okay.  I think the preference is for you to decide.  
I think that the documentation that I mentioned at 
https://fishshell.com/docs/current/interactive.html#abbreviations explains the 
difference:
"The advantage [of abbreviations] over aliases [and functions] is that you can 
see the actual command before using it, add to it or change it, and the actual 
command will be stored in history."  If you want that feature, use an 
abbreviation.  If you don't want that feature, use an alias/function.  If you 
don't care then you don't care.


_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to