mirror of
https://github.com/spf13/cobra
synced 2025-05-07 22:07:23 +00:00
Remove extra splat for zsh arrays
It turns out that zsh will simply use the elements of an array as the parameters when referenced in the shell without quotes ``` % cat t.py import sys print sys.argv % typeset -a args % args+=("./t.py") % args+=("123 321") % $args ['./t.py', '123\n321'] ```
This commit is contained in:
parent
979059b9c4
commit
53e4e28648
1 changed files with 2 additions and 2 deletions
|
@ -91,7 +91,7 @@ function {{genZshFlagDynamicCompletionFuncName .}} {
|
||||||
return $?
|
return $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! error_message="$("${tokens[@]}" 2>&1 > "$output")" ; then
|
if ! error_message="$($tokens 2>&1 > "$output")" ; then
|
||||||
local st="$?"
|
local st="$?"
|
||||||
_message "Exception occurred during completion: $error_message"
|
_message "Exception occurred during completion: $error_message"
|
||||||
return "$st"
|
return "$st"
|
||||||
|
@ -102,7 +102,7 @@ function {{genZshFlagDynamicCompletionFuncName .}} {
|
||||||
args+="$line"
|
args+="$line"
|
||||||
done < "$output"
|
done < "$output"
|
||||||
|
|
||||||
_values "$1" "$args[@]"
|
_values "$1" $args
|
||||||
|
|
||||||
unset COBRA_FLAG_COMPLETION
|
unset COBRA_FLAG_COMPLETION
|
||||||
rm "$output"
|
rm "$output"
|
||||||
|
|
Loading…
Add table
Reference in a new issue