list.sh: fix arg parsing always failing

This commit is contained in:
Bo Anderson 2024-09-02 05:25:48 +01:00
parent 2971755498
commit a101dfc466
No known key found for this signature in database

View File

@ -13,8 +13,14 @@ homebrew-list() {
local formula=""
local cask=""
local first_arg
for arg in "$@"
do
if [[ -z "${first_arg}" ]]
then
first_arg=1
[[ "${arg}" == "list" ]] && continue
fi
case "${arg}" in
# check for flags passed to ls
-1 | -l | -r | -t) ls_args+=("${arg}") ;;
@ -29,6 +35,7 @@ homebrew-list() {
if [[ -t 1 ]]
then
tty=1
source "${HOMEBREW_LIBRARY}/Homebrew/utils/helpers.sh"
fi
local error_string="LS_ERRORED"