BUGFIX: Hanging dash if neither HEAD nor $2 are set

HEAD and $2 are now pre-combined, then a "substitute if set or not-null" done to add the prefixing hyphen.
This commit is contained in:
Pandu E POLUAN 2024-02-28 10:27:42 +07:00 committed by GitHub
parent 16907c18d1
commit ab33b5d274
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,9 +27,9 @@ function _configure_eza() {
_configure_eza
function _alias_eza() {
local _tail
_tail="${(j: :)_EZA_TAIL}"
alias "$1"="eza -${(j::)_EZA_HEAD}$2${_tail:+ }${_tail}${3:+ }$3"
local _head="${(j::)_EZA_HEAD}$2"
local _tail="${(j: :)_EZA_TAIL}"
alias "$1"="eza ${_head:+-}${_head}${_tail:+ }${_tail}${3:+ }$3"
}
_alias_eza la la
@ -43,4 +43,3 @@ unfunction _alias_eza
unfunction _configure_eza
unset _EZA_HEAD
unset _EZA_TAIL