Skip to content

Commit

Permalink
fix(xfunc ARRAY filter): accept command name as predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Apr 15, 2022
1 parent 40a204e commit 72ddb92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions completions/ARRAY
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ _comp_xfunc_ARRAY_filter()
esac
;;
*)
if declare -F "$2" &>/dev/null; then
if type -t "$2" &>/dev/null; then
_comp_local_predicate="$2 \"\$_comp_local_value\""
else
_comp_local_predicate="local value=\$_comp_local_value; $2"
_comp_local_predicate="local -x value=\$_comp_local_value; $2"
fi
;;
esac
Expand Down

0 comments on commit 72ddb92

Please sign in to comment.