From 9ea00fe651873e8f550eb87ac61c6fe32cc66545 Mon Sep 17 00:00:00 2001 From: joknarf Date: Tue, 6 Feb 2024 00:16:22 +0100 Subject: [PATCH] quote a --- complete-ng | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/complete-ng b/complete-ng index 36af8a5..ba90186 100644 --- a/complete-ng +++ b/complete-ng @@ -400,15 +400,14 @@ complete() { ! [[ $1 =~ $exc ]] && { func="$1"; shift; set -- "$@" _complete-ng; continue; } } [ "$1" = "-F" ] && fn=1 && cmd=() - [ $1 = -- ] || cmd+=("$1") + [ "$1" = -- ] || cmd+=("$1") set -- "$@" "$1" shift done - [[ "$*" =~ -F\ [^\ ]*$ ]] && set -- "$@" "''" && cmd=("''") + [[ "$*" =~ -F\ [^\ ]*$ ]] && set -- "$@" "''" && cmd=( "" ) [ "$func" ] && { local c for c in "${cmd[@]}";do - c=${c//"'"/} eval "_compfunc_${c//[^a-zA-Z0-9_]/_}=$func" done }